mirror of
https://github.com/astral-sh/ruff.git
synced 2025-10-03 15:15:33 +00:00
![]() ```console ❯ cargo run rule B017 Finished dev [unoptimized + debuginfo] target(s) in 0.13s Running `target/debug/ruff rule B017` no-assert-raises-exception Code: B017 (flake8-bugbear) ### What it does Checks for `self.assertRaises(Exception)`. ## Why is this bad? `assertRaises(Exception)` can lead to your test passing even if the code being tested is never executed due to a typo. Either assert for a more specific exception (builtin or custom), use `assertRaisesRegex` or the context manager form of `assertRaises`. ``` |
||
---|---|---|
.. | ||
flake8_to_ruff | ||
ruff | ||
ruff_cli | ||
ruff_dev | ||
ruff_macros | ||
ruff_python |