Skip to content

Commit 8004c45

Browse files
authored
bpo-11105: document the new test.support.infinite_recursion context manager (pythonGH-26604)
1 parent e58d762 commit 8004c45

File tree

1 file changed

+7
-1
lines changed

1 file changed

+7
-1
lines changed

Lib/test/support/__init__.py

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -49,7 +49,7 @@
4949
# processes
5050
"reap_children",
5151
# miscellaneous
52-
"run_with_locale", "swap_item", "findfile",
52+
"run_with_locale", "swap_item", "findfile", "infinite_recursion",
5353
"swap_attr", "Matcher", "set_memlimit", "SuppressCrashReport", "sortdict",
5454
"run_with_tz", "PGO", "missing_compiler_executable",
5555
"ALWAYS_EQ", "NEVER_EQ", "LARGEST", "SMALLEST",
@@ -2002,6 +2002,12 @@ def check_disallow_instantiation(testcase, tp, *args, **kwds):
20022002

20032003
@contextlib.contextmanager
20042004
def infinite_recursion(max_depth=75):
2005+
"""Set a lower limit for tests that interact with infinite recursions
2006+
(e.g test_ast.ASTHelpers_Test.test_recursion_direct) since on some
2007+
debug windows builds, due to not enough functions being inlined the
2008+
stack size might not handle the default recursion limit (1000). See
2009+
bpo-11105 for details."""
2010+
20052011
original_depth = sys.getrecursionlimit()
20062012
try:
20072013
sys.setrecursionlimit(max_depth)

0 commit comments

Comments
 (0)