-
-
Notifications
You must be signed in to change notification settings - Fork 18.4k
Added the GH Issue number note to Writing Tests in Docs #28705
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
Conversation
@@ -949,6 +949,11 @@ the expected correct result:: | |||
|
|||
assert_frame_equal(pivoted, expected) | |||
|
|||
.. note:: | |||
|
|||
Add the GitHub Issue Number as a Comment to the New Tests. |
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.
don't need to capitalizie new tests. Can you point to an example in the code, e.g.https://github.com/pandas-dev/pandas/blob/master/pandas/tests/series/test_apply.py#L166 (or you can just replicate this here maybe better)
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.
Ok
I will change that capitalized word
and for the example - Shall i add the following line
'For Example : # GH 20714 bug fixed in: GH 24275"
or anything else?
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.
yes that sounds good (make it clear its an example :->)
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.
Or should i just replicate like
'For Example : def test_apply_categorical_with_nan_values(self, series):
# GH 20714 bug fixed in: GH 24275
s = pd.Series(series, dtype="category")
result = s.apply(lambda x: x.split("-")[0])'
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.
I'll be writing
For example - If you modify the test - "test_apply_categorical_with_nan_values" (GH 20714), please write-
def test_apply_categorical_with_nan_values(self, series):
#GH 20714 bug fixed in: GH 24275
s = pd.Series(series, dtype="category")
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.
You can just add GH XXXX
to the test that directly precedes this
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 give me an example. I'm not getting it.
What exactly should i write as an example.
Sorry for pestering
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.
See the test case in #28662 how it has # GH XXXX as a comment at the top of the test (you can find this in other PRs as well)
You can add that in the test case shown in this file
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.
I've added it in my latest commit.
Please let me know
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.
Please Check
|
||
Add the GitHub issue number as a comment to the new tests. | ||
For Example - For a test solving issue number 20172, write | ||
| # GH 20172 |
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.
Should move this to the function body. Check the test as an example in #28662 if needed
Ok |
Looks like this was superseded by #28907 |
I've added the required note at the appropriate place in the documentation.