]> git.ipfire.org Git - thirdparty/Python/cpython.git/commitdiff
gh-111809: Fix `test_deep_repr` from `test_userdict` on WASI (GH-112229)
authorNikita Sobolev <mail@sobolevn.me>
Wed, 22 Nov 2023 22:55:25 +0000 (01:55 +0300)
committerGitHub <noreply@github.com>
Wed, 22 Nov 2023 22:55:25 +0000 (14:55 -0800)
Lib/test/test_userdict.py

index 483910aaa4620efecbd713c4f10f2d57159e1053..9a03f2d04ce970a1866024fefa1e4cbe2e6c2896 100644 (file)
@@ -1,6 +1,6 @@
 # Check every path through every method of UserDict
 
-from test import mapping_tests
+from test import mapping_tests, support
 import unittest
 import collections
 
@@ -213,6 +213,11 @@ class UserDictTest(mapping_tests.TestHashMappingProtocol):
         else:
             self.fail("g[42] didn't raise KeyError")
 
+    # Decorate existing test with recursion limit, because
+    # the test is for C structure, but `UserDict` is a Python structure.
+    test_repr_deep = support.infinite_recursion()(
+        mapping_tests.TestHashMappingProtocol.test_repr_deep,
+    )
 
 
 if __name__ == "__main__":