diff options
author | Nikita Sobolev <mail@sobolevn.me> | 2023-11-07 19:23:57 (GMT) |
---|---|---|
committer | GitHub <noreply@github.com> | 2023-11-07 19:23:57 (GMT) |
commit | 0e83d941bea921380ce4a1494121f3ec30ae652e (patch) | |
tree | 76a0519f39b357d9e663fb7668398fa81d53d01f /Lib | |
parent | 2f9cb7e095370e38bde58c79c8a8ea7705eefdc2 (diff) | |
download | cpython-0e83d941bea921380ce4a1494121f3ec30ae652e.zip cpython-0e83d941bea921380ce4a1494121f3ec30ae652e.tar.gz cpython-0e83d941bea921380ce4a1494121f3ec30ae652e.tar.bz2 |
gh-111808: Fix recursion error on WASM in `test_typing` (GH-111819)
Diffstat (limited to 'Lib')
-rw-r--r-- | Lib/test/test_typing.py | 11 |
1 files changed, 6 insertions, 5 deletions
diff --git a/Lib/test/test_typing.py b/Lib/test/test_typing.py index 9dd637b..6ff79e8 100644 --- a/Lib/test/test_typing.py +++ b/Lib/test/test_typing.py @@ -44,7 +44,7 @@ import typing import weakref import types -from test.support import captured_stderr, cpython_only +from test.support import captured_stderr, cpython_only, infinite_recursion from test import mod_generics_cache from test import _typed_dict_helper @@ -5622,10 +5622,11 @@ class ForwardRefTests(BaseTestCase): def cmp(o1, o2): return o1 == o2 - r1 = namespace1() - r2 = namespace2() - self.assertIsNot(r1, r2) - self.assertRaises(RecursionError, cmp, r1, r2) + with infinite_recursion(25): # magic number, small but reasonable + r1 = namespace1() + r2 = namespace2() + self.assertIsNot(r1, r2) + self.assertRaises(RecursionError, cmp, r1, r2) def test_union_forward_recursion(self): ValueList = List['Value'] |