summaryrefslogtreecommitdiffstats
path: root/Lib/test
diff options
context:
space:
mode:
authorBatuhan Taskaya <batuhan@python.org>2021-06-08 17:39:03 (GMT)
committerGitHub <noreply@github.com>2021-06-08 17:39:03 (GMT)
commit8004c4570b1d1277ea8754e22b5eb60e63f5026c (patch)
treeb0afb85e3afc89c7b77bd7d1a7650fb06c7b1124 /Lib/test
parente58d762c1fb4ad5e021d016c80c2bc4513632d2f (diff)
downloadcpython-8004c4570b1d1277ea8754e22b5eb60e63f5026c.zip
cpython-8004c4570b1d1277ea8754e22b5eb60e63f5026c.tar.gz
cpython-8004c4570b1d1277ea8754e22b5eb60e63f5026c.tar.bz2
bpo-11105: document the new test.support.infinite_recursion context manager (GH-26604)
Diffstat (limited to 'Lib/test')
-rw-r--r--Lib/test/support/__init__.py8
1 files changed, 7 insertions, 1 deletions
diff --git a/Lib/test/support/__init__.py b/Lib/test/support/__init__.py
index d17331e..933c2c9 100644
--- a/Lib/test/support/__init__.py
+++ b/Lib/test/support/__init__.py
@@ -49,7 +49,7 @@ __all__ = [
# processes
"reap_children",
# miscellaneous
- "run_with_locale", "swap_item", "findfile",
+ "run_with_locale", "swap_item", "findfile", "infinite_recursion",
"swap_attr", "Matcher", "set_memlimit", "SuppressCrashReport", "sortdict",
"run_with_tz", "PGO", "missing_compiler_executable",
"ALWAYS_EQ", "NEVER_EQ", "LARGEST", "SMALLEST",
@@ -2002,6 +2002,12 @@ def check_disallow_instantiation(testcase, tp, *args, **kwds):
@contextlib.contextmanager
def infinite_recursion(max_depth=75):
+ """Set a lower limit for tests that interact with infinite recursions
+ (e.g test_ast.ASTHelpers_Test.test_recursion_direct) since on some
+ debug windows builds, due to not enough functions being inlined the
+ stack size might not handle the default recursion limit (1000). See
+ bpo-11105 for details."""
+
original_depth = sys.getrecursionlimit()
try:
sys.setrecursionlimit(max_depth)