mirror of
https://github.com/python/cpython.git
synced 2025-12-08 06:10:17 +00:00
[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 c176543349)
Co-authored-by: sobolevn <mail@sobolevn.me>
This commit is contained in:
parent
7880421983
commit
2de82bcc62
1 changed files with 2 additions and 2 deletions
|
|
@ -436,7 +436,7 @@ def f(): """doc"""
|
||||||
# test both direct compilation and compilation via AST
|
# test both direct compilation and compilation via AST
|
||||||
codeobjs = []
|
codeobjs = []
|
||||||
codeobjs.append(compile(codestr, "<test>", "exec", optimize=optval))
|
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))
|
codeobjs.append(compile(tree, "<test>", "exec", optimize=optval))
|
||||||
for code in codeobjs:
|
for code in codeobjs:
|
||||||
ns = {}
|
ns = {}
|
||||||
|
|
@ -624,7 +624,7 @@ def test_compile_ast(self):
|
||||||
for opt in [opt1, opt2]:
|
for opt in [opt1, opt2]:
|
||||||
opt_right = opt.value.right
|
opt_right = opt.value.right
|
||||||
self.assertIsInstance(opt_right, ast.Constant)
|
self.assertIsInstance(opt_right, ast.Constant)
|
||||||
self.assertEqual(opt_right.value, True)
|
self.assertEqual(opt_right.value, __debug__)
|
||||||
|
|
||||||
def test_delattr(self):
|
def test_delattr(self):
|
||||||
sys.spam = 1
|
sys.spam = 1
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue