Skip to content

Commit 237260d

Browse files
authored
DOC: Improve pull request template and contributing_codebase.rst (#45709)
* DOC: Improve pull request template and contributing guide * Move some information into contributing * Fix some typos
1 parent af89881 commit 237260d

File tree

3 files changed

+66
-266
lines changed

3 files changed

+66
-266
lines changed

.github/PULL_REQUEST_TEMPLATE.md

+4-4
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
- [ ] closes #xxxx
2-
- [ ] tests added / passed
3-
- [ ] Ensure all linting tests pass, see [here](https://pandas.pydata.org/pandas-docs/dev/development/contributing_codebase.html#pre-commit) for how to run them
4-
- [ ] whatsnew entry
1+
- [ ] closes #xxxx (Replace xxxx with the Github issue number)
2+
- [ ] [Tests added and passed](https://pandas.pydata.org/pandas-docs/dev/development/contributing_codebase.html#writing-tests) if fixing a bug or adding a new feature
3+
- [ ] All [code checks passed](https://pandas.pydata.org/pandas-docs/dev/development/contributing_codebase.html#pre-commit).
4+
- [ ] Added an entry in the latest `doc/source/whatsnew/vX.X.X.rst` file if fixing a bug or adding a new feature.

doc/source/development/code_style.rst

-49
Original file line numberDiff line numberDiff line change
@@ -9,61 +9,12 @@ pandas code style guide
99
.. contents:: Table of contents:
1010
:local:
1111

12-
pandas follows the `PEP8 <https://www.python.org/dev/peps/pep-0008/>`_
13-
standard and uses `Black <https://black.readthedocs.io/en/stable/>`_
14-
and `Flake8 <https://flake8.pycqa.org/en/latest/>`_ to ensure a
15-
consistent code format throughout the project. We encourage you to use
16-
:ref:`pre-commit <contributing.pre-commit>` to automatically run ``black``,
17-
``flake8``, ``isort``, and related code checks when you make a git commit.
18-
1912
Patterns
2013
========
2114

2215
We use a ``flake8`` plugin, `pandas-dev-flaker <https://github.com/pandas-dev/pandas-dev-flaker>`_, to
2316
check our codebase for unwanted patterns. See its ``README`` for the up-to-date list of rules we enforce.
2417

25-
Testing
26-
=======
27-
28-
Failing tests
29-
--------------
30-
31-
See https://docs.pytest.org/en/latest/how-to/skipping.html for background.
32-
33-
Do not use ``pytest.xfail``
34-
---------------------------
35-
36-
Do not use this method. It has the same behavior as ``pytest.skip``, namely
37-
it immediately stops the test and does not check if the test will fail. If
38-
this is the behavior you desire, use ``pytest.skip`` instead.
39-
40-
Using ``pytest.mark.xfail``
41-
---------------------------
42-
43-
Use this method if a test is known to fail but the manner in which it fails
44-
is not meant to be captured. It is common to use this method for a test that
45-
exhibits buggy behavior or a non-implemented feature. If
46-
the failing test has flaky behavior, use the argument ``strict=False``. This
47-
will make it so pytest does not fail if the test happens to pass.
48-
49-
Prefer the decorator ``@pytest.mark.xfail`` and the argument ``pytest.param``
50-
over usage within a test so that the test is appropriately marked during the
51-
collection phase of pytest. For xfailing a test that involves multiple
52-
parameters, a fixture, or a combination of these, it is only possible to
53-
xfail during the testing phase. To do so, use the ``request`` fixture:
54-
55-
.. code-block:: python
56-
57-
import pytest
58-
59-
def test_xfail(request):
60-
mark = pytest.mark.xfail(raises=TypeError, reason="Indicate why here")
61-
request.node.add_marker(mark)
62-
63-
xfail is not to be used for tests involving failure due to invalid user arguments.
64-
For these tests, we need to verify the correct exception type and error message
65-
is being raised, using ``pytest.raises`` instead.
66-
6718
Miscellaneous
6819
=============
6920

0 commit comments

Comments
 (0)