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.
This commit is contained in:
Erlend E. Aasland 2024-04-08 14:45:25 +02:00 committed by GitHub
parent 9a12f5d1c1
commit ca62ffd1a5
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
14 changed files with 32 additions and 35 deletions

View file

@ -1424,7 +1424,7 @@ class ExceptionTests(unittest.TestCase):
next(generator)
recursionlimit = sys.getrecursionlimit()
try:
recurse(support.EXCEEDS_RECURSION_LIMIT)
recurse(support.exceeds_recursion_limit())
finally:
sys.setrecursionlimit(recursionlimit)
print('Done.')