Skip to content
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

TST: Disallow bare pytest.raises #31045

Merged
merged 2 commits into from
Jan 16, 2020
Merged

TST: Disallow bare pytest.raises #31045

merged 2 commits into from
Jan 16, 2020

Conversation

gdex1
Copy link
Contributor

@gdex1 gdex1 commented Jan 15, 2020

This pull request is to add appropriate match arguments to bare pytest.raises listed in the comment #30999 (comment) as described by the referenced issue.

@gdex1
Copy link
Contributor Author

gdex1 commented Jan 15, 2020

I would like to verify that I am approaching the issue correctly on this single test before I move on to the rest of them. My error message is based on the three formats of error messages that are currently raised by this test. Is this an acceptable match argument?

Another question, running "black pandas" modifies many files in the code base, should I just ignore this and only run it on files I modify or are my settings improperly configured?

Could you comment on this @MomIsBestFriend ? Thanks.

EDIT: Another question, there seems to be many failed tests in pytest locally even before I change the code. Is my setup incorrect or is this expected?

@simonjayhawkins
Copy link
Member

Thanks @gdex1 for the PR. The approach looks about right.

This one may be a bit tricky though. The test is parameterized and it appears that the user-facing error messages are not consistent. The test failures point to not all the combinations being represented in msg. (such as must be str, not DatetimeArray)

@simonjayhawkins simonjayhawkins added the Testing pandas testing functions or related to the test suite label Jan 15, 2020
@ShaharNaveh
Copy link
Member

Another question, running "black pandas" modifies many files in the code base, should I just ignore this and only run it on files I modify or are my settings improperly configured?

Weird, have you set your virtual environment / conda environment as described in the pandas contributing guide ?

EDIT: Another question, there seems to be many failed tests in pytest locally even before I change the code. Is my setup incorrect or is this expected?

Might be also related to the same reason that Black is changing a lot of files, have you compiled all the extensions?

Copy link
Member

@WillAyd WillAyd left a comment

Choose a reason for hiding this comment

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

lgtm

@simonjayhawkins simonjayhawkins added this to the 1.1 milestone Jan 16, 2020
@simonjayhawkins simonjayhawkins merged commit 2ba6be7 into pandas-dev:master Jan 16, 2020
@simonjayhawkins
Copy link
Member

Thanks @gdex1

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.

4 participants