-
Notifications
You must be signed in to change notification settings - Fork 104
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
B017 support the matches keyword argument to pytest.raises #334
Comments
nsoranzo
added a commit
to nsoranzo/flake8-bugbear
that referenced
this issue
Jan 18, 2023
Fix PyCQA#334 . Also add more tests for when we should and shouldn't emit B017. In particular we should check ``assertRaises`` and ``pytest.raises`` calls outside of with statements.
nsoranzo
added a commit
to nsoranzo/flake8-bugbear
that referenced
this issue
Jan 19, 2023
Fix PyCQA#334 . Also add more tests for when we should and shouldn't emit B017. In particular we should check ``assertRaises`` and ``pytest.raises`` calls outside of with statements.
cooperlees
pushed a commit
that referenced
this issue
Jan 19, 2023
) Fix #334 . Also add more tests for when we should and shouldn't emit B017. In particular we should check ``assertRaises`` and ``pytest.raises`` calls outside of with statements.
busgaidw2
added a commit
to busgaidw2/flake8-bugbear
that referenced
this issue
Aug 6, 2024
…337) Fix PyCQA/flake8-bugbear#334 . Also add more tests for when we should and shouldn't emit B017. In particular we should check ``assertRaises`` and ``pytest.raises`` calls outside of with statements.
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
#317 added support for warning about B017 when using
pytest.raises(Exception)
, and it included an exception for passing a regex to match against similar to unittest.assertRaisesRegex. But you can pass that regex as a keyword argument too and that exception doesn't apply in that case.Docs with an example of passing the
match
keyword: https://docs.pytest.org/en/7.1.x/how-to/assert.html#assertions-about-expected-exceptionsReproducer:
The text was updated successfully, but these errors were encountered: