11import unittest
22from test .support import (verbose , refcount_test , run_unittest ,
3- strip_python_stderr , cpython_only , start_threads ,
4- temp_dir )
3+ strip_python_stderr , cpython_only , start_threads ,
4+ temp_dir , requires_type_collecting )
55from test .support .script_helper import assert_python_ok , make_script
66
77import sys
@@ -118,6 +118,7 @@ class A:
118118 del a
119119 self .assertNotEqual (gc .collect (), 0 )
120120
121+ @requires_type_collecting
121122 def test_newinstance (self ):
122123 class A (object ):
123124 pass
@@ -678,6 +679,7 @@ def run_command(code):
678679 stderr = run_command (code % "gc.DEBUG_SAVEALL" )
679680 self .assertNotIn (b"uncollectable objects at shutdown" , stderr )
680681
682+ @requires_type_collecting
681683 def test_gc_main_module_at_shutdown (self ):
682684 # Create a reference cycle through the __main__ module and check
683685 # it gets collected at interpreter shutdown.
@@ -692,6 +694,7 @@ def __del__(self):
692694 rc , out , err = assert_python_ok ('-c' , code )
693695 self .assertEqual (out .strip (), b'__del__ called' )
694696
697+ @requires_type_collecting
695698 def test_gc_ordinary_module_at_shutdown (self ):
696699 # Same as above, but with a non-__main__ module.
697700 with temp_dir () as script_dir :
0 commit comments