Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 5 additions & 3 deletions Lib/test/test_typing.py
Original file line number Diff line number Diff line change
Expand Up @@ -53,7 +53,7 @@
from test.support import (
captured_stderr, cpython_only, requires_docstrings, import_helper, run_code,
subTests, EqualToForwardRef,
exceeds_recursion_limit, run_with_limited_c_stack,
run_with_limited_c_stack,
skip_wasi_stack_overflow, skip_emscripten_stack_overflow,
)
from test.typinganndata import (
Expand Down Expand Up @@ -5097,12 +5097,14 @@ class MM2(collections.abc.MutableMapping, MutableMapping[str, str]):
self.assertEqual(MM2.__bases__, (collections.abc.MutableMapping, Generic))

@cpython_only
@run_with_limited_c_stack()
@run_with_limited_c_stack(500_000)
@skip_wasi_stack_overflow()
@skip_emscripten_stack_overflow()
def test_parameters_deep_recursion(self):
# _Py_make_parameters() has small C frames (48 bytes per level
# on 32-bit ARM), so 150_000 levels can fit in the limited C stack.
x = [0]
for _ in range(exceeds_recursion_limit()):
for _ in range(500_000):
x = [x]
with self.assertRaisesRegex(RecursionError, "in __parameter__ calculation"):
list[x].__parameters__
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
Fix ``test_typing.GenericTests.test_parameters_deep_recursion`` on 32-bit
ARM debug builds, where 150,000 nested lists did not exhaust the limited C
stack.
Loading