Skip to content

Commit 60528d5

Browse files
Pierre-Sassoulasseifertm
authored andcommitted
[ruff] Add bugbears check
1 parent 0eb7c0a commit 60528d5

File tree

2 files changed

+7
-2
lines changed

2 files changed

+7
-2
lines changed

pyproject.toml

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -69,6 +69,7 @@ write_to = "pytest_asyncio/_version.py"
6969
[tool.ruff]
7070
line-length = 88
7171
lint.select = [
72+
"B", # bugbear
7273
"E", # pycodestyle
7374
"F", # pyflakes
7475
"PGH004", # pygrep-hooks - Use specific rule codes when using noqa
@@ -79,6 +80,10 @@ lint.select = [
7980
"UP", # pyupgrade
8081
"W", # pycodestyle
8182
]
83+
lint.ignore = [
84+
# bugbear ignore
85+
"B028", # No explicit `stacklevel` keyword argument found
86+
]
8287

8388
[tool.pytest.ini_options]
8489
python_files = [

pytest_asyncio/plugin.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -183,11 +183,11 @@ def _get_asyncio_mode(config: Config) -> Mode:
183183
val = config.getini("asyncio_mode")
184184
try:
185185
return Mode(val)
186-
except ValueError:
186+
except ValueError as e:
187187
modes = ", ".join(m.value for m in Mode)
188188
raise pytest.UsageError(
189189
f"{val!r} is not a valid asyncio_mode. Valid modes: {modes}."
190-
)
190+
) from e
191191

192192

193193
_DEFAULT_FIXTURE_LOOP_SCOPE_UNSET = """\

0 commit comments

Comments
 (0)