Skip to content

CLN: Clean reductions/test_reductions.py #32035

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 4 commits into from
Feb 17, 2020
Merged

CLN: Clean reductions/test_reductions.py #32035

merged 4 commits into from
Feb 17, 2020

Conversation

dsaxton
Copy link
Member

@dsaxton dsaxton commented Feb 16, 2020

Some more parameterizing / splitting up of tests

@pytest.mark.parametrize("dtype", ["M8[ns]", "datetime64[ns, UTC]"])
def test_nanops_empty_object(self, opname, index_or_series, dtype):
klass = index_or_series
arg_op = "arg" + opname if klass is Index else "idx" + opname
Copy link
Contributor

Choose a reason for hiding this comment

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

why is this needed?

Copy link
Member Author

Choose a reason for hiding this comment

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

I broke this into its own test since it allows for parametrizing over these dtypes without repeating all of test_nanops (which was / is pretty big), and this was conceptually a bit more specific than just "testing nanops"

Copy link
Contributor

Choose a reason for hiding this comment

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

i get that, but why is arg_op specifically needed? what is its purpose

Copy link
Member Author

Choose a reason for hiding this comment

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

Oh, I think the name of the method being tested changes if it's a Series or Index (idxmin or argmin) so it has to be created dynamically in the test?

@jreback jreback added Refactor Internal refactoring of code Testing pandas testing functions or related to the test suite labels Feb 16, 2020
@jreback jreback added this to the 1.1 milestone Feb 17, 2020
@jreback jreback merged commit 3b4b86b into pandas-dev:master Feb 17, 2020
@jreback
Copy link
Contributor

jreback commented Feb 17, 2020

thanks @dsaxton

@dsaxton dsaxton deleted the clean-reduce-test branch February 17, 2020 20:05
roberthdevries pushed a commit to roberthdevries/pandas that referenced this pull request Mar 2, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Refactor Internal refactoring of code Testing pandas testing functions or related to the test suite
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants