File tree Expand file tree Collapse file tree 1 file changed +7
-1
lines changed Expand file tree Collapse file tree 1 file changed +7
-1
lines changed Original file line number Diff line number Diff line change 88import subprocess
99import sys
1010import unittest
11+ import warnings
1112from argparse import Namespace
1213from pathlib import Path
1314
@@ -54,7 +55,12 @@ def test_eval(
5455 ]
5556
5657 bbc = BugBearChecker (filename = str (path ), options = options )
57- 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" ))]
5864 errors .sort ()
5965 assert errors == tuple_expected
6066
You can’t perform that action at this time.
0 commit comments