-
-
Notifications
You must be signed in to change notification settings - Fork 18.4k
DOC: test organization #37760
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
DOC: test organization #37760
Conversation
@jorisvandenbossche thoughts on the rst? |
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.
Didn't look yet at the actual content, but a few comments on the rest markup (I commented mostly on the first bullet point, but it needs to be fixed for the full file, to be clear)
be located. | ||
|
||
1. Does your test depend only on code in ``pd._libs.tslibs``? | ||
This test likely belongs in one of: |
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.
This line needs to be aligned with the "Does .." from the line above. See eg https://www.sphinx-doc.org/en/master/usage/restructuredtext/basics.html#lists-and-quote-like-blocks for rst syntax for lists (and nested lists)
1. Does your test depend only on code in ``pd._libs.tslibs``? | ||
This test likely belongs in one of: | ||
|
||
- tests.tslibs |
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.
This also needs to be aligned with the "Does .." from the first line of this bullet point (the doc link I gave above also has an example of nested lists)
|
||
- tests.tslibs | ||
|
||
.. note:: |
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.
This note is part of the "tests.tslibs" text block, so the start of this (the ..) needs to align with "tests.tslibs"
In cases like this, the test location should be based on the *underlying* method being tested. Or in the case of a test for a bugfix, the location of the actual bug. So in this example, we know that ``Series.__getitem__`` calls ``Series.loc.__getitem__``, so this is *really* a test for ``loc.__getitem__``. So this test belongs in ``tests.indexing.test_loc`` | ||
|
||
6. Is your test for a DataFrame or Series method? | ||
A) Is the method a plotting method? |
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.
When starting a sub-item (the A) list item), there needs to be a blank line preceding it to make the separation with the previous (parent) item clear
result = ser.loc[[3, 4]] | ||
tm.assert_series_equal(result, expected) | ||
|
||
In cases like this, the test location should be based on the *underlying* method being tested. Or in the case of a test for a bugfix, the location of the actual bug. So in this example, we know that ``Series.__getitem__`` calls ``Series.loc.__getitem__``, so this is *really* a test for ``loc.__getitem__``. So this test belongs in ``tests.indexing.test_loc`` |
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.
Can you hard-wrap those lines?
@jorisvandenbossche thanks for the notes, implementing them now |
thanks @jbrockmendel merging this, will likely be updating as we go so if more comments can handle then. |
Retry of #37637, reverted by #37756