@@ -1583,11 +1583,7 @@ def recurse_in_body_and_except():
15831583 sys .setrecursionlimit (recursionlimit )
15841584
15851585
1586- @cpython_only
1587- # Python built with Py_TRACE_REFS fail with a fatal error in
1588- # _PyRefchain_Trace() on memory allocation error.
1589- @unittest .skipIf (support .Py_TRACE_REFS , 'cannot test Py_TRACE_REFS build' )
1590- @unittest .skipIf (_testcapi is None , "requires _testcapi" )
1586+ @support .nomemtest
15911587 def test_recursion_normalizing_with_no_memory (self ):
15921588 # Issue #30697. Test that in the abort that occurs when there is no
15931589 # memory left and the size of the Python frames stack is greater than
@@ -1774,11 +1770,7 @@ def test_unhandled(self):
17741770 self .assertIn ("test message" , report )
17751771 self .assertEndsWith (report , "\n " )
17761772
1777- @cpython_only
1778- # Python built with Py_TRACE_REFS fail with a fatal error in
1779- # _PyRefchain_Trace() on memory allocation error.
1780- @unittest .skipIf (support .Py_TRACE_REFS , 'cannot test Py_TRACE_REFS build' )
1781- @unittest .skipIf (_testcapi is None , "requires _testcapi" )
1773+ @support .nomemtest
17821774 def test_memory_error_in_PyErr_PrintEx (self ):
17831775 code = """if 1:
17841776 import _testcapi
@@ -1936,12 +1928,8 @@ def test_keyerror_context(self):
19361928 exc2 = None
19371929
19381930
1939- @cpython_only
1940- # Python built with Py_TRACE_REFS fail with a fatal error in
1941- # _PyRefchain_Trace() on memory allocation error.
1942- @unittest .skipIf (support .Py_TRACE_REFS , 'cannot test Py_TRACE_REFS build' )
1931+ @support .nomemtest
19431932 def test_exec_set_nomemory_hang (self ):
1944- import_module ("_testcapi" )
19451933 # gh-134163: A MemoryError inside code that was wrapped by a try/except
19461934 # block would lead to an infinite loop.
19471935
0 commit comments