Skip to content

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

Closed
wants to merge 3 commits into from
Closed

Added the GH Issue number note to Writing Tests in Docs #28705

wants to merge 3 commits into from

Conversation

KiranAkadas
Copy link

@KiranAkadas KiranAkadas commented Oct 1, 2019

@jreback jreback added Docs Testing pandas testing functions or related to the test suite labels Oct 1, 2019
@jreback jreback added this to the 1.0 milestone Oct 1, 2019
@@ -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.
Copy link
Contributor

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)

Copy link
Author

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?

Copy link
Contributor

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 :->)

Copy link
Author

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])'

Copy link
Author

@KiranAkadas KiranAkadas Oct 1, 2019

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")

Copy link
Member

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

Copy link
Author

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

Copy link
Member

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

Copy link
Author

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

Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Please Check

@jreback jreback mentioned this pull request Oct 1, 2019
5 tasks

Add the GitHub issue number as a comment to the new tests.
For Example - For a test solving issue number 20172, write
| # GH 20172
Copy link
Member

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

@KiranAkadas
Copy link
Author

Ok
I'm on it

@WillAyd
Copy link
Member

WillAyd commented Oct 15, 2019

Looks like this was superseded by #28907

@WillAyd WillAyd closed this Oct 15, 2019
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Docs Testing pandas testing functions or related to the test suite
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Add Note About Referencing GH Issue Number to Test in Contrib Guide
3 participants