summaryrefslogtreecommitdiffstats
path: root/Lib/test/test_compile.py
diff options
context:
space:
mode:
authorIrit Katriel <1055913+iritkatriel@users.noreply.github.com>2024-01-22 17:12:06 (GMT)
committerGitHub <noreply@github.com>2024-01-22 17:12:06 (GMT)
commited30a3c337f30abd2ea5357565a956ed3dc0719c (patch)
tree6e84f66d9ab5c30101a5f69527952a48d65c54c5 /Lib/test/test_compile.py
parenta53e56e7d88b4f2a2943c9f191024198009fcf9e (diff)
downloadcpython-ed30a3c337f30abd2ea5357565a956ed3dc0719c.zip
cpython-ed30a3c337f30abd2ea5357565a956ed3dc0719c.tar.gz
cpython-ed30a3c337f30abd2ea5357565a956ed3dc0719c.tar.bz2
gh-114083: apply optimization of LOAD_CONST instructions to the whole CFG before optimize_basic_block. (#114408)
Diffstat (limited to 'Lib/test/test_compile.py')
-rw-r--r--Lib/test/test_compile.py14
1 files changed, 11 insertions, 3 deletions
diff --git a/Lib/test/test_compile.py b/Lib/test/test_compile.py
index 9c36f05..3b1cece 100644
--- a/Lib/test/test_compile.py
+++ b/Lib/test/test_compile.py
@@ -449,9 +449,17 @@ class TestSpecifics(unittest.TestCase):
compile('if (5 if 5 else T): 0', '<eval>', 'exec')
def test_condition_expression_with_redundant_comparisons_compiles(self):
- # See gh-113054
- with self.assertWarns(SyntaxWarning):
- compile('if 9<9<9and 9or 9:9', '<eval>', 'exec')
+ # See gh-113054, gh-114083
+ exprs = [
+ 'if 9<9<9and 9or 9:9',
+ 'if 9<9<9and 9or 9or 9:9',
+ 'if 9<9<9and 9or 9or 9or 9:9',
+ 'if 9<9<9and 9or 9or 9or 9or 9:9',
+ ]
+ for expr in exprs:
+ with self.subTest(expr=expr):
+ with self.assertWarns(SyntaxWarning):
+ compile(expr, '<eval>', 'exec')
def test_dead_code_with_except_handler_compiles(self):
compile(textwrap.dedent("""