Skip to content

TST: Use pytest or decorator instead of checking ImportError #45152

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 3 commits into from
Jan 2, 2022

Conversation

mroeschke
Copy link
Member

  • tests added / passed
  • Ensure all linting tests pass, see here for how to run them

@mroeschke mroeschke added the Testing pandas testing functions or related to the test suite label Jan 1, 2022
@jreback jreback added this to the 1.4 milestone Jan 1, 2022
Copy link
Member

@MarcoGorelli MarcoGorelli left a comment

Choose a reason for hiding this comment

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

Nice! Just got a question

assert_stat_op_api("kurt", float_frame, float_string_frame)
except ImportError:
pass
@pytest.mark.filterwarnings("ignore:Dropping of nuisance:FutureWarning")
Copy link
Member

Choose a reason for hiding this comment

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

why is this necessary?

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'm getting

pandas/tests/frame/test_reductions.py::TestDataFrameAnalytics::test_stat_op_api_skew_kurt
  /pandas/tests/frame/test_reductions.py:160: FutureWarning: Dropping of nuisance columns in DataFrame reductions (with 'numeric_only=None') is deprecated; in a future version this will raise TypeError.  Select only valid columns before calling the reduction.
    getattr(float_string_frame, opname)(axis=0)

without it. Copying it from the original larger test, guessing it's based on the fixture data and assert_stat_op_api

Copy link
Member

Choose a reason for hiding this comment

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

Ah, I hadn't noticed it was part of the original test, thanks for explaining

Copy link
Member

@MarcoGorelli MarcoGorelli left a comment

Choose a reason for hiding this comment

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

looks good to me, seems like a nice cleanup

@mroeschke mroeschke merged commit 0c59142 into pandas-dev:master Jan 2, 2022
@mroeschke mroeschke deleted the tst/importerror branch January 2, 2022 21:40
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Testing pandas testing functions or related to the test suite
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants