Skip to content

Commit eb7367e

Browse files
sobolevnaisk
authored andcommitted
pythongh-111808: Fix recursion error on WASM in test_typing (pythonGH-111819)
1 parent abeaf80 commit eb7367e

File tree

1 file changed

+6
-5
lines changed

1 file changed

+6
-5
lines changed

Lib/test/test_typing.py

Lines changed: 6 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -44,7 +44,7 @@
4444
import weakref
4545
import types
4646

47-
from test.support import captured_stderr, cpython_only
47+
from test.support import captured_stderr, cpython_only, infinite_recursion
4848
from test import mod_generics_cache
4949
from test import _typed_dict_helper
5050

@@ -5622,10 +5622,11 @@ def fun(x: a): pass
56225622
def cmp(o1, o2):
56235623
return o1 == o2
56245624

5625-
r1 = namespace1()
5626-
r2 = namespace2()
5627-
self.assertIsNot(r1, r2)
5628-
self.assertRaises(RecursionError, cmp, r1, r2)
5625+
with infinite_recursion(25): # magic number, small but reasonable
5626+
r1 = namespace1()
5627+
r2 = namespace2()
5628+
self.assertIsNot(r1, r2)
5629+
self.assertRaises(RecursionError, cmp, r1, r2)
56295630

56305631
def test_union_forward_recursion(self):
56315632
ValueList = List['Value']

0 commit comments

Comments
 (0)