From: Kirill Podoprigora Date: Thu, 11 Jan 2024 11:25:07 +0000 (+0300) Subject: gh-113932: assert ``SyntaxWarning`` in test_compile.TestSpecifics.test_… (#113933) X-Git-Tag: v3.13.0a3~90 X-Git-Url: http://git.ipfire.org/gitweb.cgi?a=commitdiff_plain;h=9f088336b268dfe9011a7cb550f4e488ccd7e8f5;p=thirdparty%2FPython%2Fcpython.git gh-113932: assert ``SyntaxWarning`` in test_compile.TestSpecifics.test_… (#113933) --- diff --git a/Lib/test/test_compile.py b/Lib/test/test_compile.py index 785097742898..45fd30987760 100644 --- a/Lib/test/test_compile.py +++ b/Lib/test/test_compile.py @@ -450,7 +450,8 @@ class TestSpecifics(unittest.TestCase): def test_condition_expression_with_redundant_comparisons_compiles(self): # See gh-113054 - compile('if 9<9<9and 9or 9:9', '', 'exec') + with self.assertWarns(SyntaxWarning): + compile('if 9<9<9and 9or 9:9', '', 'exec') def test_dead_code_with_except_handler_compiles(self): compile(textwrap.dedent("""