Skip to content

TST: GH30999 Add match=msg to all pytest.raises in tests/reductions and add an error message to nanmedian #38720

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

Conversation

moink
Copy link
Member

@moink moink commented Dec 27, 2020

This pull request partially addresses xref #30999 to remove bare pytest.raises by adding match=msg. It doesn't close that issue as I have only addressed test modules in the pandas/tests/reductions directory.

When going through the tests I found one case where the error message was the empty string. I decided that wasn't correct so I modified the TypeError to inherit the error message from the ValueError it was raising from. This made the error message similar to other messages in the same test.

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

@jreback jreback added Error Reporting Incorrect or improved errors from pandas Testing pandas testing functions or related to the test suite labels Dec 27, 2020
@jreback jreback added this to the 1.3 milestone Dec 27, 2020
Copy link
Contributor

@jreback jreback left a comment

Choose a reason for hiding this comment

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

…based on PR feedback

Pass None, which means it matches any message.
@jreback jreback merged commit ee77500 into pandas-dev:master Dec 30, 2020
@jreback
Copy link
Contributor

jreback commented Dec 30, 2020

thanks @moink

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
Error Reporting Incorrect or improved errors from pandas 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