Commit 1e61504b authored by Pablo Galindo's avatar Pablo Galindo Committed by GitHub

bpo-37289: Add a test for if with ifexpr in the peephole optimiser to detect regressions (GH-14127)

parent c68e3fb1
......@@ -421,6 +421,14 @@ class TestTranforms(BytecodeTestCase):
return 0
self.assertEqual(f(), 1)
def test_if_with_if_expression(self):
# Check bpo-37289
def f(x):
if (True if x else False):
return True
return False
self.assertTrue(f(True))
class TestBuglets(unittest.TestCase):
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment