-
Notifications
You must be signed in to change notification settings - Fork 109
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
Extend B017 to pytest.raises #169
Comments
Sounds reasonable. Unit-tested adding to B017 will be merged. |
I have a case where I use:
Currently, B017 catches this as a problematic but I have a valid |
I still feel it's a good practice to subclass Exception here too ... If someone wants to add if |
The error currently says Which I assume refers to the unittest functions. But, it'd be weird to suggest using assertRaisesRegex() and then say that |
@AbdealiLoKo As a workaround, you can use https://github.com/m-burst/flake8-pytest-style/blob/master/docs/rules/PT011.md to catch that. |
Sure thanks @mrcljx will take a look. |
Appears this has been resolved (probably someone forgot the 'fixes' in a PR?). |
Yup. This is all done. Thanks for the nudge. |
FWIW - I dislike using |
with pytest.raises(Exception):
is very similar toassertRaises
, and all the justification of B017 applies to that too.The text was updated successfully, but these errors were encountered: