summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorMiss Islington (bot) <31488909+miss-islington@users.noreply.github.com>2025-07-10 09:30:07 (GMT)
committerGitHub <noreply@github.com>2025-07-10 09:30:07 (GMT)
commit2de82bcc62ddcaae7af0f53f59cb019a791a61d3 (patch)
tree8ffa2db372c5c6e645c01bbd1e5cf7fc0d1ee3fb
parent78804219832a3965784093c76132beeadc762dc0 (diff)
downloadcpython-2de82bcc62ddcaae7af0f53f59cb019a791a61d3.zip
cpython-2de82bcc62ddcaae7af0f53f59cb019a791a61d3.tar.gz
cpython-2de82bcc62ddcaae7af0f53f59cb019a791a61d3.tar.bz2
[3.14] gh-136438: Make sure `test_builtins` pass with all optimization levels (GH-136474) (#136496)
gh-136438: Make sure `test_builtins` pass with all optimization levels (GH-136474) (cherry picked from commit c17654334946b232aa296696cf70ec93a09d8156) Co-authored-by: sobolevn <mail@sobolevn.me>
-rw-r--r--Lib/test/test_builtin.py4
1 files changed, 2 insertions, 2 deletions
diff --git a/Lib/test/test_builtin.py b/Lib/test/test_builtin.py
index 14fe335..8830641 100644
--- a/Lib/test/test_builtin.py
+++ b/Lib/test/test_builtin.py
@@ -436,7 +436,7 @@ class BuiltinTest(ComplexesAreIdenticalMixin, unittest.TestCase):
# 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 @@ class BuiltinTest(ComplexesAreIdenticalMixin, unittest.TestCase):
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