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

Disallow bare pytest.raises #31029

Closed
wants to merge 3 commits into from
Closed

Conversation

DylanBrdt
Copy link

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

#30999

@@ -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):
Copy link
Member

Choose a reason for hiding this comment

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

where is msg defined?

@gfyoung gfyoung added Code Style Code style, linting, code_checks Testing pandas testing functions or related to the test suite labels Jan 15, 2020
@simonjayhawkins
Copy link
Member

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):
Copy link
Member

Choose a reason for hiding this comment

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

Suggested change
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.

@MarcoGorelli
Copy link
Member

Hi @DylanBrdt - are you still interested in working on this?

@DylanBrdt
Copy link
Author

@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.
Thank you.

@simonjayhawkins
Copy link
Member

OK. closing for now.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Code Style Code style, linting, code_checks Testing pandas testing functions or related to the test suite
Projects
None yet
Development

Successfully merging this pull request may close these issues.

5 participants