https://github.com/python/cpython/commit/c17654334946b232aa296696cf70ec93a09d8156
commit: c17654334946b232aa296696cf70ec93a09d8156
branch: main
author: sobolevn <[email protected]>
committer: sobolevn <[email protected]>
date: 2025-07-10T11:57:29+03:00
summary:
gh-136438: Make sure `test_builtins` pass with all optimization levels (#136474)
files:
M Lib/test/test_builtin.py
diff --git a/Lib/test/test_builtin.py b/Lib/test/test_builtin.py
index 14fe3355239615..8830641f0abdc7 100644
--- a/Lib/test/test_builtin.py
+++ b/Lib/test/test_builtin.py
@@ -436,7 +436,7 @@ def f(): """doc"""
# test both direct compilation and compilation via AST
codeobjs = []
codeobjs.append(compile(codestr, "<test>", "exec",
optimize=optval))
- tree = ast.parse(codestr)
+ tree = ast.parse(codestr, optimize=optval)
codeobjs.append(compile(tree, "<test>", "exec",
optimize=optval))
for code in codeobjs:
ns = {}
@@ -624,7 +624,7 @@ def test_compile_ast(self):
for opt in [opt1, opt2]:
opt_right = opt.value.right
self.assertIsInstance(opt_right, ast.Constant)
- self.assertEqual(opt_right.value, True)
+ self.assertEqual(opt_right.value, __debug__)
def test_delattr(self):
sys.spam = 1
_______________________________________________
Python-checkins mailing list -- [email protected]
To unsubscribe send an email to [email protected]
https://mail.python.org/mailman3//lists/python-checkins.python.org
Member address: [email protected]