ruff
97dd6d12 - [`flake8-pytest-style`] Avoid false positive for legacy form of `pytest.raises` (`PT011`) (#17231)

Commit
305 days ago
[`flake8-pytest-style`] Avoid false positive for legacy form of `pytest.raises` (`PT011`) (#17231) This fix closes #17026 ## Summary The check for the `PytestRaisesTooBroad` rule is now skipped if there is a second positional argument present, which means `pytest.raises` is used as a function. ## Test Plan Tested on the example from the issue, which now passes the check. ```Python3 pytest.raises(Exception, func, *func_args, **func_kwargs).match("error message") ``` --------- Co-authored-by: Micha Reiser <micha@reiser.io>
Parents
Loading