https://github.com/python/cpython/commit/429fd0aca357f704cb35d0405dab23e0dbb7285f
commit: 429fd0aca357f704cb35d0405dab23e0dbb7285f
branch: main
author: Victor Stinner <[email protected]>
committer: vstinner <[email protected]>
date: 2026-11-05T11:05:32Z
summary:

gh-161354: Fix test_ast.test_nodes_have_inline_values() (#161406)

Run the test in a subprocess to make it more deterministic.

files:
M Lib/test/test_ast/test_ast.py

diff --git a/Lib/test/test_ast/test_ast.py b/Lib/test/test_ast/test_ast.py
index 095bc5832f6aca6..45e953dfe0a7132 100644
--- a/Lib/test/test_ast/test_ast.py
+++ b/Lib/test/test_ast/test_ast.py
@@ -25,6 +25,7 @@
     _testinternalcapi = None
 
 from test import support
+from test.support import isolation
 from test.support import os_helper
 from test.support import (skip_emscripten_stack_overflow,
                           skip_wasi_stack_overflow,
@@ -104,6 +105,10 @@ def test_AST_objects(self):
             ast.AST(2)
 
     @unittest.skipIf(_testinternalcapi is None, "requires _testinternalcapi")
+    # gh-161354: Run the test in a subprocess to make it more deterministic.
+    # Inline values depend on Constant_type.ht_cached_keys which changes when
+    # ast.Constant instances are created, so they depend on other run tests.
+    @isolation.runInSubprocess()
     def test_nodes_have_inline_values(self):
         tree = ast.parse("x = f(y, z=1)")
         for node in ast.walk(tree):

_______________________________________________
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]

Reply via email to