Skip to content

Commit f8a9143

Browse files
committed
Drop 'failing' depth
1 parent e697926 commit f8a9143

File tree

1 file changed

+7
-8
lines changed

1 file changed

+7
-8
lines changed

Lib/test/test_ast/test_ast.py

Lines changed: 7 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -747,7 +747,6 @@ def next(self):
747747
@support.cpython_only
748748
@skip_emscripten_stack_overflow()
749749
def test_ast_recursion_limit(self):
750-
fail_depth = 100_000
751750
crash_depth = 200_000
752751
success_depth = 200
753752
if _testinternalcapi is not None:
@@ -757,13 +756,13 @@ def test_ast_recursion_limit(self):
757756
def check_limit(prefix, repeated):
758757
expect_ok = prefix + repeated * success_depth
759758
ast.parse(expect_ok)
760-
for depth in (fail_depth, crash_depth):
761-
broken = prefix + repeated * depth
762-
details = "Compiling ({!r} + {!r} * {})".format(
763-
prefix, repeated, depth)
764-
with self.assertRaises(RecursionError, msg=details):
765-
with support.infinite_recursion():
766-
ast.parse(broken)
759+
760+
broken = prefix + repeated * crash_depth
761+
details = "Compiling ({!r} + {!r} * {})".format(
762+
prefix, repeated, crash_depth)
763+
with self.assertRaises(RecursionError, msg=details):
764+
with support.infinite_recursion():
765+
ast.parse(broken)
767766

768767
check_limit("a", "()")
769768
check_limit("a", ".b")

0 commit comments

Comments
 (0)