-
Notifications
You must be signed in to change notification settings - Fork 1.8k
Closed
Labels
bugSomething isn't workingSomething isn't workinghelp wantedContributions especially welcomeContributions especially welcome
Description
$ cat t.py
import contextlib
import pytest
def test_():
with pytest.raises(Exception):
pass
with (
contextlib.nullcontext(),
pytest.raises(Exception),
):
pass
$ ruff check --select B017 t.py
t.py:6:10: B017 `pytest.raises(Exception)` should be considered evil
|
5 | def test_():
6 | with pytest.raises(Exception):
| ^^^^^^^^^^^^^^^^^^^^^^^^ B017
7 | pass
|
Found 1 error.This should report both occurrences of pytest.raises(Exception), but the second one is missing.
$ python --version --version
Python 3.12.5 (v3.12.5:ff3bc82f7c9, Aug 7 2024, 05:32:06) [Clang 13.0.0 (clang-1300.0.29.30)]
$ ruff --version
ruff 0.6.8Reactions are currently unavailable
Metadata
Metadata
Assignees
Labels
bugSomething isn't workingSomething isn't workinghelp wantedContributions especially welcomeContributions especially welcome