-
-
Notifications
You must be signed in to change notification settings - Fork 17.9k
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: GH30999 add match=msg to all pytest.raises in pandas/tests/window #38804
TST: GH30999 add match=msg to all pytest.raises in pandas/tests/window #38804
Conversation
@@ -44,7 +44,7 @@ def f(x): | |||
expected = df.iloc[2:].reindex_like(df) | |||
tm.assert_frame_equal(result, expected) | |||
|
|||
with pytest.raises(AttributeError): | |||
with tm.external_error_raised(AttributeError): |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
what is this error?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
AttributeError: 'numpy.ndarray' object has no attribute 'index'
in both cases
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I suppose from a numpy array not having an index
attribute
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
hmm. i think we could raise a better message here as to what the issue is (trying to use pandas functions inside the rolling when raw=True). cc @mroeschke let me create an issue.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
thanks @moink |
This pull request partially addresses xref #30999 to remove bare
pytest.raises
by addingmatch=msg
. It doesn't close that issue as I have only addressed test modules in the pandas/tests/window/ directory.I have added
match=msg
to 3 instances ofpytest.raises
and converted another to atm.external_error_raised
. Nothing complicated or controversial, imo.black pandas
git diff upstream/master -u -- "*.py" | flake8 --diff