2525
2626from test import support
2727from test .support import os_helper
28- from test .support import skip_emscripten_stack_overflow , skip_wasi_stack_overflow
28+ from test .support import skip_emscripten_stack_overflow , skip_wasi_stack_overflow , skip_if_unlimited_stack_size
2929from test .support .ast_helper import ASTTestMixin
3030from test .support .import_helper import ensure_lazy_imports
3131from test .test_ast .utils import to_tuple
@@ -989,6 +989,7 @@ def next(self):
989989 enum ._test_simple_enum (_Precedence , _ast_unparse ._Precedence )
990990
991991 @support .cpython_only
992+ @skip_if_unlimited_stack_size
992993 @skip_wasi_stack_overflow ()
993994 @skip_emscripten_stack_overflow ()
994995 def test_ast_recursion_limit (self ):
@@ -1127,6 +1128,7 @@ def test_pickling(self):
11271128 ast2 = pickle .loads (pickle .dumps (tree , protocol ))
11281129 self .assertEqual (to_tuple (ast2 ), to_tuple (tree ))
11291130
1131+ @skip_if_unlimited_stack_size
11301132 def test_copy_with_parents (self ):
11311133 # gh-120108
11321134 code = """
@@ -1974,6 +1976,7 @@ def test_level_as_none(self):
19741976 exec (code , ns )
19751977 self .assertIn ('sleep' , ns )
19761978
1979+ @skip_if_unlimited_stack_size
19771980 @skip_emscripten_stack_overflow ()
19781981 def test_recursion_direct (self ):
19791982 e = ast .UnaryOp (op = ast .Not (), lineno = 0 , col_offset = 0 , operand = ast .Constant (1 ))
@@ -1982,6 +1985,7 @@ def test_recursion_direct(self):
19821985 with support .infinite_recursion ():
19831986 compile (ast .Expression (e ), "<test>" , "eval" )
19841987
1988+ @skip_if_unlimited_stack_size
19851989 @skip_emscripten_stack_overflow ()
19861990 def test_recursion_indirect (self ):
19871991 e = ast .UnaryOp (op = ast .Not (), lineno = 0 , col_offset = 0 , operand = ast .Constant (1 ))
0 commit comments