|
141 | 141 | ctypes = None |
142 | 142 | from test.support import (cpython_only, |
143 | 143 | check_impl_detail, requires_debug_ranges, |
144 | | - gc_collect, Py_GIL_DISABLED) |
| 144 | + gc_collect, Py_GIL_DISABLED, |
| 145 | + suppress_immortalization) |
145 | 146 | from test.support.script_helper import assert_python_ok |
146 | 147 | from test.support import threading_helper, import_helper |
147 | 148 | from test.support.bytecode_helper import instructions_with_positions |
@@ -577,6 +578,7 @@ def test_interned_string_with_null(self): |
577 | 578 |
|
578 | 579 | class CodeWeakRefTest(unittest.TestCase): |
579 | 580 |
|
| 581 | + @suppress_immortalization() |
580 | 582 | def test_basic(self): |
581 | 583 | # Create a code object in a clean environment so that we know we have |
582 | 584 | # the only reference to it left. |
@@ -827,6 +829,7 @@ def test_bad_index(self): |
827 | 829 | self.assertEqual(GetExtra(f.__code__, FREE_INDEX+100, |
828 | 830 | ctypes.c_voidp(100)), 0) |
829 | 831 |
|
| 832 | + @suppress_immortalization() |
830 | 833 | def test_free_called(self): |
831 | 834 | # Verify that the provided free function gets invoked |
832 | 835 | # when the code object is cleaned up. |
@@ -854,6 +857,7 @@ def test_get_set(self): |
854 | 857 | del f |
855 | 858 |
|
856 | 859 | @threading_helper.requires_working_threading() |
| 860 | + @suppress_immortalization() |
857 | 861 | def test_free_different_thread(self): |
858 | 862 | # Freeing a code object on a different thread then |
859 | 863 | # where the co_extra was set should be safe. |
|
0 commit comments