Skip to content

bpo-37289: Add a test for if with ifexpr in the peephole optimizer to detect regressions #14127

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 2 commits into from
Jun 20, 2019
Merged
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
fixup! bpo-37289: Add a test for if with ifexpr in the peephole optim…
…izer to detect regressions
  • Loading branch information
pablogsal committed Jun 16, 2019
commit 860c7c67cffabec1bee29fec2280e0ad12cf3651
6 changes: 3 additions & 3 deletions Lib/test/test_peepholer.py
Original file line number Diff line number Diff line change
Expand Up @@ -423,11 +423,11 @@ def f():

def test_if_with_if_expression(self):
# Check bpo-37289
def f():
if True if f.__code__ else None:
def f(x):
if (True if x else False):
return True
return False
self.assertTrue(f())
self.assertTrue(f(True))


class TestBuglets(unittest.TestCase):
Expand Down