[flake8-bugbear] Skip B028 if warnings.warn is called with *args or **kwargs (#14870)

This commit is contained in:
Harutaka Kawamura 2024-12-09 23:32:37 +09:00 committed by GitHub
parent 172143ae77
commit 9c3c59aca9
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
3 changed files with 31 additions and 13 deletions

View file

@ -11,6 +11,13 @@ warnings.warn("test", DeprecationWarning, source=None, stacklevel=2)
warnings.warn("test", DeprecationWarning, stacklevel=1)
warnings.warn("test", DeprecationWarning, 1)
warnings.warn("test", category=DeprecationWarning, stacklevel=1)
args = ("test", DeprecationWarning, 1)
warnings.warn(*args)
kwargs = {"message": "test", "category": DeprecationWarning, "stacklevel": 1}
warnings.warn(**kwargs)
args = ("test", DeprecationWarning)
kwargs = {"stacklevel": 1}
warnings.warn(*args, **kwargs)
warnings.warn(
"test",