-
-
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
Disallow bare pytest.raises #31029
Disallow bare pytest.raises #31029
Conversation
pandas/tests/io/test_html.py
Outdated
@@ -276,14 +276,14 @@ def test_file_like(self): | |||
|
|||
@tm.network | |||
def test_bad_url_protocol(self): | |||
with pytest.raises(URLError): | |||
with pytest.raises(URLError, match=msg): |
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.
where is msg defined?
Thanks @DylanBrdt for the PR. In future you should create a new branch on your local fork when making a PR request. see https://dev.pandas.io/docs/development/contributing.html#creating-a-branch |
@@ -1374,7 +1374,7 @@ def test_unsupported_datetype(self): | |||
"dates": dates, | |||
} | |||
) | |||
with pytest.raises(NotImplementedError): | |||
with pytest.raises(NotImplementedError, match=msg): |
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.
with pytest.raises(NotImplementedError, match=msg): | |
with pytest.raises( | |
NotImplementedError, | |
match=re.escape("Data type datetime64[ns, Asia/Hong_Kong] not supported."), | |
): |
also re needs to be imported.
Hi @DylanBrdt - are you still interested in working on this? |
@MarcoGorelli I appreciate your consideration of asking me. Unfortunately, I am still learning OSS and want to learn the basics of git before I attempt any more issues. |
OK. closing for now. |
black pandas
git diff upstream/master -u -- "*.py" | flake8 --diff
#30999