PyCQA / flake8

flake8 is a python tool that glues together pycodestyle, pyflakes, mccabe, and third-party plugins to check the style and quality of some python code.

Home Page:https://flake8.pycqa.org

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

B017 - Suppress warning when msg param is passed to assertRaises

slw07g opened this issue · comments

describe the request

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.

Flake8 does not define any checks or implement them which is clearly described in the issue template and documentation. Please find the correct place to file this instead