@@ -1531,11 +1531,7 @@ def recurse_in_body_and_except():
15311531 sys .setrecursionlimit (recursionlimit )
15321532
15331533
1534- @cpython_only
1535- # Python built with Py_TRACE_REFS fail with a fatal error in
1536- # _PyRefchain_Trace() on memory allocation error.
1537- @unittest .skipIf (support .Py_TRACE_REFS , 'cannot test Py_TRACE_REFS build' )
1538- @unittest .skipIf (_testcapi is None , "requires _testcapi" )
1534+ @support .nomemtest
15391535 def test_recursion_normalizing_with_no_memory (self ):
15401536 # Issue #30697. Test that in the abort that occurs when there is no
15411537 # memory left and the size of the Python frames stack is greater than
@@ -1719,11 +1715,7 @@ def test_unhandled(self):
17191715 self .assertIn ("test message" , report )
17201716 self .assertTrue (report .endswith ("\n " ))
17211717
1722- @cpython_only
1723- # Python built with Py_TRACE_REFS fail with a fatal error in
1724- # _PyRefchain_Trace() on memory allocation error.
1725- @unittest .skipIf (support .Py_TRACE_REFS , 'cannot test Py_TRACE_REFS build' )
1726- @unittest .skipIf (_testcapi is None , "requires _testcapi" )
1718+ @support .nomemtest
17271719 def test_memory_error_in_PyErr_PrintEx (self ):
17281720 code = """if 1:
17291721 import _testcapi
@@ -1857,12 +1849,8 @@ def test_memory_error_in_subinterp(self):
18571849 rc , _ , err = script_helper .assert_python_ok ("-c" , code )
18581850 self .assertIn (b'MemoryError' , err )
18591851
1860- @cpython_only
1861- # Python built with Py_TRACE_REFS fail with a fatal error in
1862- # _PyRefchain_Trace() on memory allocation error.
1863- @unittest .skipIf (support .Py_TRACE_REFS , 'cannot test Py_TRACE_REFS build' )
1852+ @support .nomemtest
18641853 def test_exec_set_nomemory_hang (self ):
1865- import_module ("_testcapi" )
18661854 # gh-134163: A MemoryError inside code that was wrapped by a try/except
18671855 # block would lead to an infinite loop.
18681856
0 commit comments