Skip to content

Commit 7059cc2

Browse files
committed
test: ignore a SyntaxWarning caused by one of our tests
1 parent 7e3acd9 commit 7059cc2

File tree

2 files changed

+5
-0
lines changed

2 files changed

+5
-0
lines changed

tests/conftest.py

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -60,6 +60,9 @@ def set_warnings() -> None:
6060

6161
warnings.filterwarnings("ignore", r".*no-sysmon")
6262

63+
# We have a test that has a return in a finally: test_bug_1891.
64+
warnings.filterwarnings("ignore", "'return' in a 'finally' block", category=SyntaxWarning)
65+
6366

6467
@pytest.fixture(autouse=True)
6568
def reset_sys_path() -> Iterator[None]:

tests/test_parser.py

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -207,6 +207,8 @@ def test_bug_1891(self) -> None:
207207
)
208208
""")
209209
assert parser.exit_counts() == {1: 1}
210+
# In conftest.py, we silence the SyntaxWarning this code causes. If
211+
# we remove this code, we can probably remove that warning.
210212
parser = self.parse_text("""\
211213
def g2():
212214
try:

0 commit comments

Comments
 (0)