aboutsummaryrefslogtreecommitdiffstatshomepage
path: root/Lib/test/mapping_tests.py
diff options
context:
space:
mode:
authorErlend E. Aasland <erlend@python.org>2024-04-08 14:45:25 +0200
committerGitHub <noreply@github.com>2024-04-08 14:45:25 +0200
commitca62ffd1a5ef41401abceddfd171c76c68825a35 (patch)
treebc5ece1694f0d99642446844f74be11ebd7e53b0 /Lib/test/mapping_tests.py
parent9a12f5d1c19dee1f89684be776680aeaf117be5b (diff)
downloadcpython-ca62ffd1a5ef41401abceddfd171c76c68825a35.tar.gz
cpython-ca62ffd1a5ef41401abceddfd171c76c68825a35.zip
gh-116303: Skip tests if C recursion limit is unavailable (GH-117368)
The test suite fetches the C recursion limit from the _testcapi extension module. Test extension modules can be disabled using the --disable-test-modules configure option.
Diffstat (limited to 'Lib/test/mapping_tests.py')
-rw-r--r--Lib/test/mapping_tests.py4
1 files changed, 2 insertions, 2 deletions
diff --git a/Lib/test/mapping_tests.py b/Lib/test/mapping_tests.py
index b4cfce19a71..ed89a81a6ea 100644
--- a/Lib/test/mapping_tests.py
+++ b/Lib/test/mapping_tests.py
@@ -1,7 +1,7 @@
# tests common to dict and UserDict
import unittest
import collections
-from test.support import Py_C_RECURSION_LIMIT
+from test.support import get_c_recursion_limit
class BasicTestMappingProtocol(unittest.TestCase):
@@ -624,7 +624,7 @@ class TestHashMappingProtocol(TestMappingProtocol):
def test_repr_deep(self):
d = self._empty_mapping()
- for i in range(Py_C_RECURSION_LIMIT + 1):
+ for i in range(get_c_recursion_limit() + 1):
d0 = d
d = self._empty_mapping()
d[1] = d0