|
1 | 1 | import unittest |
2 | 2 | import unittest.mock |
3 | 3 | from test.support import (verbose, refcount_test, |
4 | | - cpython_only, requires_subprocess, Py_GIL_DISABLED) |
| 4 | + cpython_only, requires_subprocess, |
| 5 | + requires_gil_enabled) |
5 | 6 | from test.support.import_helper import import_module |
6 | 7 | from test.support.os_helper import temp_dir, TESTFN, unlink |
7 | 8 | from test.support.script_helper import assert_python_ok, make_script |
@@ -362,7 +363,7 @@ def __del__(self): |
362 | 363 | # To minimize variations, though, we first store the get_count() results |
363 | 364 | # and check them at the end. |
364 | 365 | @refcount_test |
365 | | - @unittest.skipIf(Py_GIL_DISABLED, 'needs precise allocation counts') |
| 366 | + @requires_gil_enabled('needs precise allocation counts') |
366 | 367 | def test_get_count(self): |
367 | 368 | gc.collect() |
368 | 369 | a, b, c = gc.get_count() |
@@ -815,7 +816,7 @@ def test_get_objects(self): |
815 | 816 | any(l is element for element in gc.get_objects()) |
816 | 817 | ) |
817 | 818 |
|
818 | | - @unittest.skipIf(Py_GIL_DISABLED, 'need generational GC') |
| 819 | + @requires_gil_enabled('need generational GC') |
819 | 820 | def test_get_objects_generations(self): |
820 | 821 | gc.collect() |
821 | 822 | l = [] |
@@ -1046,7 +1047,7 @@ def setUp(self): |
1046 | 1047 | def tearDown(self): |
1047 | 1048 | gc.disable() |
1048 | 1049 |
|
1049 | | - @unittest.skipIf(Py_GIL_DISABLED, "Free threading does not support incremental GC") |
| 1050 | + @requires_gil_enabled("Free threading does not support incremental GC") |
1050 | 1051 | # Use small increments to emulate longer running process in a shorter time |
1051 | 1052 | @gc_threshold(200, 10) |
1052 | 1053 | def test_incremental_gc_handles_fast_cycle_creation(self): |
|
0 commit comments