|
14 | 14 | SuppressCrashReport, |
15 | 15 | SHORT_TIMEOUT, |
16 | 16 | ) |
17 | | -from test.support.script_helper import kill_python, spawn_python |
| 17 | +from test.support.script_helper import kill_python |
18 | 18 | from test.support.import_helper import import_module |
19 | 19 |
|
20 | 20 | try: |
@@ -98,35 +98,6 @@ def test_no_memory(self): |
98 | 98 | # Exit code 120: Py_FinalizeEx() failed to flush stdout and stderr. |
99 | 99 | self.assertIn(p.returncode, (1, 120)) |
100 | 100 |
|
101 | | - @cpython_only |
102 | | - # Python built with Py_TRACE_REFS fail with a fatal error in |
103 | | - # _PyRefchain_Trace() on memory allocation error. |
104 | | - @unittest.skipIf(support.Py_TRACE_REFS, 'cannot test Py_TRACE_REFS build') |
105 | | - def test_exec_set_nomemory_hang(self): |
106 | | - import_module("_testcapi") |
107 | | - # gh-134163: Test case that triggers no memory hang condition |
108 | | - # The frame_lasti need to upper 257, |
109 | | - # because when calling PyLong_FromLong, malloc is not invoked, |
110 | | - # so no MemError is triggered |
111 | | - # we need to warm up the memory to reproduce the issue |
112 | | - warmup_code = "a = list(range(0, 1))\n" * 20 |
113 | | - user_input = warmup_code + dedent(""" |
114 | | - try: |
115 | | - import _testcapi |
116 | | - _testcapi.set_nomemory(0) |
117 | | - b = list(range(1000, 2000)) |
118 | | - except Exception as e: |
119 | | - import traceback |
120 | | - traceback.print_exc() |
121 | | - """) |
122 | | - with SuppressCrashReport(): |
123 | | - p = spawn_python('-c', user_input) |
124 | | - output = kill_python(p) |
125 | | - |
126 | | - self.assertIn(p.returncode, (0, 1, 120)) |
127 | | - self.assertGreater(len(output), 0) # At minimum, should not hang |
128 | | - self.assertIn(b"MemoryError", output) |
129 | | - |
130 | 101 | @cpython_only |
131 | 102 | def test_multiline_string_parsing(self): |
132 | 103 | # bpo-39209: Multiline string tokens need to be handled in the tokenizer |
|
0 commit comments