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
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 5 additions & 0 deletions doc/source/development/contributing.rst
Original file line number Diff line number Diff line change
Expand Up @@ -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



Transitioning to ``pytest``
~~~~~~~~~~~~~~~~~~~~~~~~~~~

Expand Down