[flake8-bugbear] noqa B023 not bound by design

This commit is contained in:
Pierre Sassoulas 2024-02-02 21:26:49 +01:00
parent 41ff3584d7
commit 4eb246d4e1
2 changed files with 1 additions and 2 deletions

View File

@ -145,7 +145,6 @@ ignore = [
"B009", # Do not call `getattr` with a constant attribute value
"B010", # [*] Do not call `setattr` with a constant attribute value.
"B011", # Do not `assert False` (`python -O` removes these calls)
"B023", # Function definition does not bind loop variable `warning`
"B028", # No explicit `stacklevel` keyword argument found
# pycodestyle ignore
# pytest can do weird low-level things, and we usually know

View File

@ -228,7 +228,7 @@ class TestDeprecatedCall:
for warning in other_warnings:
def f():
warnings.warn(warning("hi"))
warnings.warn(warning("hi")) # noqa: B023
with pytest.warns(warning):
with pytest.raises(pytest.fail.Exception):