We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
1 parent 1155216 commit 33e6d47Copy full SHA for 33e6d47
1 file changed
tests/test_bugbear.py
@@ -8,6 +8,7 @@
8
import subprocess
9
import sys
10
import unittest
11
+import warnings
12
from argparse import Namespace
13
from pathlib import Path
14
@@ -54,7 +55,12 @@ def test_eval(
54
55
]
56
57
bbc = BugBearChecker(filename=str(path), options=options)
- errors = [e for e in bbc.run() if (test == "B950" or not e[2].startswith("B950"))]
58
+ # Suppress SyntaxWarnings for B012 tests which intentionally contain
59
+ # return/break/continue in finally blocks (SyntaxWarning in Python 3.14+)
60
+ with warnings.catch_warnings():
61
+ if test.startswith("B012"):
62
+ warnings.filterwarnings("ignore", category=SyntaxWarning)
63
+ errors = [e for e in bbc.run() if (test == "B950" or not e[2].startswith("B950"))]
64
errors.sort()
65
assert errors == tuple_expected
66
0 commit comments