Skip to content

Commit cc149d8

Browse files
committed
Adjust a couple of tests
1 parent 3f3ec46 commit cc149d8

File tree

2 files changed

+3
-5
lines changed

2 files changed

+3
-5
lines changed

Lib/test/test_ast.py

+1-1
Original file line numberDiff line numberDiff line change
@@ -1126,7 +1126,7 @@ def next(self):
11261126
def test_ast_recursion_limit(self):
11271127
fail_depth = support.EXCEEDS_RECURSION_LIMIT
11281128
crash_depth = 100_000
1129-
success_depth = 1200
1129+
success_depth = int(support.Py_C_RECURSION_LIMIT * 0.8)
11301130
if _testinternalcapi is not None:
11311131
remaining = _testinternalcapi.get_c_recursion_remaining()
11321132
success_depth = min(success_depth, remaining)

Lib/test/test_sys_settrace.py

+2-4
Original file line numberDiff line numberDiff line change
@@ -3037,10 +3037,8 @@ def test_trace_unpack_long_sequence(self):
30373037
self.assertEqual(counts, {'call': 1, 'line': 301, 'return': 1})
30383038

30393039
def test_trace_lots_of_globals(self):
3040-
count = 1000
3041-
if _testinternalcapi is not None:
3042-
remaining = _testinternalcapi.get_c_recursion_remaining()
3043-
count = min(count, remaining)
3040+
3041+
count = min(1000, int(support.Py_C_RECURSION_LIMIT * 0.8))
30443042

30453043
code = """if 1:
30463044
def f():

0 commit comments

Comments
 (0)