Skip to content

Commit 9a42166

Browse files
committed
remove test_constant_folding
`test_constant_folding` scenarios are covered in other more specific tests
1 parent 2c7b401 commit 9a42166

1 file changed

Lines changed: 0 additions & 22 deletions

File tree

Lib/test/test_peepholer.py

Lines changed: 0 additions & 22 deletions
Original file line numberDiff line numberDiff line change
@@ -349,28 +349,6 @@ def g()->1+1:
349349
self.assertNotInBytecode(f, 'BINARY_OP')
350350
self.check_lnotab(f)
351351

352-
def test_constant_folding(self):
353-
# Issue #11244: aggressive constant folding.
354-
exprs = [
355-
'3 * -5',
356-
'-3 * 5',
357-
'2 * (3 * 4)',
358-
'(2 * 3) * 4',
359-
'(-1, 2, 3)',
360-
'(1, -2, 3)',
361-
'(1, 2, -3)',
362-
'(1, 2, -3) * 6',
363-
'lambda x: x in {(3 * -5) + (-1 - 6), (1, -2, 3) * 2, None}',
364-
]
365-
for e in exprs:
366-
with self.subTest(e=e):
367-
code = compile(e, '', 'single')
368-
for instr in dis.get_instructions(code):
369-
self.assertFalse(instr.opname.startswith('UNARY_'))
370-
self.assertFalse(instr.opname.startswith('BINARY_'))
371-
self.assertFalse(instr.opname.startswith('BUILD_'))
372-
self.check_lnotab(code)
373-
374352
def test_constant_folding_small_int(self):
375353
tests = [
376354
('(0, )[0]', 0),

0 commit comments

Comments
 (0)