-
-
Notifications
You must be signed in to change notification settings - Fork 18.4k
DOC: test organization #37637
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Merged
Merged
DOC: test organization #37637
Changes from 7 commits
Commits
Show all changes
9 commits
Select commit
Hold shift + click to select a range
51a4baf
DOC: test organization
jbrockmendel f2c67b0
flesh out doc
jbrockmendel c134ca0
md->rst
jbrockmendel 86f61f7
Merge branch 'master' of https://github.com/pandas-dev/pandas into do…
jbrockmendel d706ac6
Troubleshoot docbuild
jbrockmendel 37c28cc
Merge branch 'master' of https://github.com/pandas-dev/pandas into do…
jbrockmendel 606a07c
doc for test_item
jbrockmendel 7b1c26e
Merge branch 'master' of https://github.com/pandas-dev/pandas into do…
jbrockmendel a6e7c72
flesh out rules
jbrockmendel File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -21,3 +21,4 @@ Development | |
policies | ||
roadmap | ||
meeting | ||
test_writing | ||
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,103 @@ | ||
.. _test_organization: | ||
|
||
Test organization | ||
================= | ||
Ideally, there should be one, and only one, obvious place for a test to reside. | ||
Until we reach that ideal, these are some rules of thumb for where a test should | ||
be located. | ||
|
||
1. Does your test depend only on code in ``pd._libs.tslibs``? | ||
This test likely belongs in one of: | ||
|
||
- tests.tslibs | ||
|
||
.. note:: | ||
|
||
No file in ``tests.tslibs`` should import from any pandas modules outside of ``pd._libs.tslibs`` | ||
|
||
- tests.scalar | ||
- tests.tseries.offsets | ||
|
||
2. Does your test depend only on code in pd._libs? | ||
This test likely belongs in one of: | ||
|
||
- tests.libs | ||
- tests.groupby.test_libgroupby | ||
|
||
3. Is your test for an arithmetic or comparison method? | ||
This test likely belongs in one of: | ||
|
||
- tests.arithmetic | ||
|
||
.. note:: | ||
|
||
These are intended for tests that can be shared to test the behavior of DataFrame/Series/Index/ExtensionArray using the ``box_with_array`` fixture. | ||
|
||
- tests.frame.test_arithmetic | ||
- tests.series.test_arithmetic | ||
|
||
4. Is your test for a reduction method (min, max, sum, prod, ...)? | ||
This test likely belongs in one of: | ||
|
||
- tests.reductions | ||
|
||
.. note:: | ||
These are intended for tests that can be shared to test the behavior of DataFrame/Series/Index/ExtensionArray. | ||
|
||
- tests.frame.test_reductions | ||
- tests.series.test_reductions | ||
- tests.test_nanops | ||
|
||
5. Is your test for a DataFrame or Series method? | ||
A) Is the method a plotting method? | ||
This test likely belongs in one of: | ||
|
||
- tests.plotting | ||
|
||
B) Is the method an IO method? | ||
This test likely belongs in one of: | ||
|
||
- tests.io | ||
|
||
C) Is the method an indexing method? | ||
i) Is the method ``loc``, ``iloc``, ``at``, or ``iat``? | ||
This test likely belongs in one of: | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. can you be a little more precise here (e.g. do we have criteria for putting in pandas/tests/indexing over the frame/series ones? (can be a TODO of course) |
||
|
||
- tests.indexing.test_methodname | ||
|
||
ii) Otherwise | ||
This test likely belongs in one of: | ||
|
||
- tests.frame.indexing.test_methodname | ||
- tests.series.indexing.test_methodname | ||
|
||
D) Otherwise | ||
This test likely belongs in one of: | ||
|
||
- tests.series.methods.test_mymethod | ||
- tests.frame.methods.test_mymethod | ||
|
||
.. note:: | ||
|
||
If a test can be shared between DataFrame/Series using the ``frame_or_series`` fixture, by convention it goes in tests.frame file. | ||
|
||
- tests.generic.methods.test_mymethod | ||
|
||
.. note:: | ||
|
||
The generic/methods/ directory is only for methods with tests that are fully parametrized over Series/DataFrame | ||
|
||
6. Is your test for an Index method, not depending on Series/DataFrame? | ||
This test likely belongs in one of: | ||
|
||
- tests.indexes | ||
|
||
7) Is your test for one of the pandas-provided ExtensionArrays (Categorical, DatetimeArray, TimedeltaArray, PeriodArray, IntervalArray, PandasArray, FloatArray, BoolArray, IntervalArray, StringArray)? | ||
This test likely belongs in one of: | ||
|
||
- tests.arrays | ||
|
||
8) Is your test for *all* ExtensionArray subclasses (the "EA Interface")? | ||
This test likely belongs in one of: | ||
|
||
- tests.extension |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
maybe put after internals