Skip to content

Commit 429fd0a

Browse files
authored
gh-161354: Fix test_ast.test_nodes_have_inline_values() (#161406)
Run the test in a subprocess to make it more deterministic.
1 parent ed27405 commit 429fd0a

1 file changed

Lines changed: 5 additions & 0 deletions

File tree

‎Lib/test/test_ast/test_ast.py‎

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -25,6 +25,7 @@
2525
_testinternalcapi = None
2626

2727
from test import support
28+
from test.support import isolation
2829
from test.support import os_helper
2930
from test.support import (skip_emscripten_stack_overflow,
3031
skip_wasi_stack_overflow,
@@ -104,6 +105,10 @@ def test_AST_objects(self):
104105
ast.AST(2)
105106

106107
@unittest.skipIf(_testinternalcapi is None, "requires _testinternalcapi")
108+
# gh-161354: Run the test in a subprocess to make it more deterministic.
109+
# Inline values depend on Constant_type.ht_cached_keys which changes when
110+
# ast.Constant instances are created, so they depend on other run tests.
111+
@isolation.runInSubprocess()
107112
def test_nodes_have_inline_values(self):
108113
tree = ast.parse("x = f(y, z=1)")
109114
for node in ast.walk(tree):

0 commit comments

Comments
 (0)