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

B017 - assertRaises - ignore when msg param is passed #479

Open
slw07g opened this issue Jun 26, 2024 · 2 comments
Open

B017 - assertRaises - ignore when msg param is passed #479

slw07g opened this issue Jun 26, 2024 · 2 comments

Comments

@slw07g
Copy link

slw07g commented Jun 26, 2024

Consider suppressing B017 where msg= is passed to assertRaises, as it also validates the actual message in the raised exception matches msg.

Example:
assertRaises(Exception, msg="Some exception message")

It is equivalent to assertRaisesRegex(Exception, "^<regex_pattern>$") which does not trigger B017.

@slw07g
Copy link
Author

slw07g commented Jun 26, 2024

Opened an issue in the flake8 repo.
PyCQA/flake8#1940

@slw07g slw07g closed this as not planned Won't fix, can't repro, duplicate, stale Jun 26, 2024
@slw07g
Copy link
Author

slw07g commented Jun 26, 2024

Reopening because maybe this is the right repo for the issue.

@slw07g slw07g reopened this Jun 26, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant