Skip to content

REF: simplify logic in assert_produces_warning #38637

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 2 commits into from
Dec 22, 2020

Conversation

ivanovmg
Copy link
Member

@ivanovmg ivanovmg commented Dec 22, 2020

  • closes #xxxx
  • tests added / passed
  • passes black pandas
  • passes git diff upstream/master -u -- "*.py" | flake8 --diff
  • whatsnew entry

Simplified logic in assert_produces_warning by extracting functions _assert_caught_expected_warning, _assert_caught_no_extra_warnings and _is_unexpected_warning.

*,
caught_warnings: Sequence[warnings.WarningMessage],
expected_warning: Optional[Union[Type[Warning], bool]],
):
Copy link
Contributor

Choose a reason for hiding this comment

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

can you add a doc-string here

@jreback jreback added the Testing pandas testing functions or related to the test suite label Dec 22, 2020
@jreback jreback added this to the 1.3 milestone Dec 22, 2020
@jreback jreback merged commit f37c27c into pandas-dev:master Dec 22, 2020
@jreback
Copy link
Contributor

jreback commented Dec 22, 2020

thanks @ivanovmg

luckyvs1 pushed a commit to luckyvs1/pandas that referenced this pull request Jan 20, 2021
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.

2 participants