Skip to content

Commit 084e5ff

Browse files
committed
GH-111798: skip test_super_deep() from test_call under pydebug builds on WASI
1 parent 3aa4b83 commit 084e5ff

File tree

2 files changed

+6
-6
lines changed

2 files changed

+6
-6
lines changed

Lib/test/test_call.py

+4-6
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,6 @@
11
import unittest
2-
from test.support import cpython_only, requires_limited_api, skip_on_s390x
2+
from test.support import (cpython_only, is_wasi, requires_limited_api, Py_DEBUG,
3+
set_recursion_limit, skip_on_s390x)
34
try:
45
import _testcapi
56
except ImportError:
@@ -990,6 +991,7 @@ def case_change_over_substitution(BLuch=None, Luch = None, fluch = None):
990991
class TestRecursion(unittest.TestCase):
991992

992993
@skip_on_s390x
994+
@unittest.skipIf(is_wasi and Py_DEBUG, "requires deep stack")
993995
def test_super_deep(self):
994996

995997
def recurse(n):
@@ -1010,9 +1012,7 @@ def c_py_recurse(m):
10101012
if m:
10111013
_testcapi.pyobject_vectorcall(py_recurse, (1000, m), ())
10121014

1013-
depth = sys.getrecursionlimit()
1014-
sys.setrecursionlimit(100_000)
1015-
try:
1015+
with set_recursion_limit(100_000):
10161016
recurse(90_000)
10171017
with self.assertRaises(RecursionError):
10181018
recurse(101_000)
@@ -1022,8 +1022,6 @@ def c_py_recurse(m):
10221022
c_py_recurse(90)
10231023
with self.assertRaises(RecursionError):
10241024
c_py_recurse(100_000)
1025-
finally:
1026-
sys.setrecursionlimit(depth)
10271025

10281026

10291027
class TestFunctionWithManyArgs(unittest.TestCase):
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,2 @@
1+
Disable ``test_super_deep()`` from ``test_call`` under pydebug builds on
2+
WASI; the stack depth is too small to make the test useful.

0 commit comments

Comments
 (0)