@@ -1575,11 +1575,7 @@ def recurse_in_body_and_except():
15751575 sys .setrecursionlimit (recursionlimit )
15761576
15771577
1578- @cpython_only
1579- # Python built with Py_TRACE_REFS fail with a fatal error in
1580- # _PyRefchain_Trace() on memory allocation error.
1581- @unittest .skipIf (support .Py_TRACE_REFS , 'cannot test Py_TRACE_REFS build' )
1582- @unittest .skipIf (_testcapi is None , "requires _testcapi" )
1578+ @support .nomemtest
15831579 def test_recursion_normalizing_with_no_memory (self ):
15841580 # Issue #30697. Test that in the abort that occurs when there is no
15851581 # memory left and the size of the Python frames stack is greater than
@@ -1766,11 +1762,7 @@ def test_unhandled(self):
17661762 self .assertIn ("test message" , report )
17671763 self .assertEndsWith (report , "\n " )
17681764
1769- @cpython_only
1770- # Python built with Py_TRACE_REFS fail with a fatal error in
1771- # _PyRefchain_Trace() on memory allocation error.
1772- @unittest .skipIf (support .Py_TRACE_REFS , 'cannot test Py_TRACE_REFS build' )
1773- @unittest .skipIf (_testcapi is None , "requires _testcapi" )
1765+ @support .nomemtest
17741766 def test_memory_error_in_PyErr_PrintEx (self ):
17751767 code = """if 1:
17761768 import _testcapi
@@ -1928,12 +1920,8 @@ def test_keyerror_context(self):
19281920 exc2 = None
19291921
19301922
1931- @cpython_only
1932- # Python built with Py_TRACE_REFS fail with a fatal error in
1933- # _PyRefchain_Trace() on memory allocation error.
1934- @unittest .skipIf (support .Py_TRACE_REFS , 'cannot test Py_TRACE_REFS build' )
1923+ @support .nomemtest
19351924 def test_exec_set_nomemory_hang (self ):
1936- import_module ("_testcapi" )
19371925 # gh-134163: A MemoryError inside code that was wrapped by a try/except
19381926 # block would lead to an infinite loop.
19391927
0 commit comments