File tree Expand file tree Collapse file tree 1 file changed +3
-10
lines changed
Expand file tree Collapse file tree 1 file changed +3
-10
lines changed Original file line number Diff line number Diff line change @@ -134,6 +134,7 @@ def test_ClearWeakRefsNoCallbacks_no_weakref_support(self):
134134 _testcapi .pyobject_clear_weakrefs_no_callbacks (obj )
135135
136136
137+ @threading_helper .requires_working_threading ()
137138class EnableDeferredRefcountingTest (unittest .TestCase ):
138139 """Test PyUnstable_Object_EnableDeferredRefcount"""
139140 @support .requires_resource ("cpu" )
@@ -158,21 +159,13 @@ def silly_func(obj):
158159
159160 silly_list = [1 , 2 , 3 ]
160161 threads = [
161- Thread (target = silly_func , args = (silly_list ,)) for _ in range (5 )
162+ Thread (target = silly_func , args = (silly_list ,)) for _ in range (4 )
162163 ]
163164
164- with threading_helper .catch_threading_exception () as cm :
165- for t in threads :
166- t .start ()
167-
165+ with threading_helper .start_threads (threads ):
168166 for i in range (10 ):
169167 silly_list .append (i )
170168
171- for t in threads :
172- t .join ()
173-
174- self .assertIsNone (cm .exc_value )
175-
176169 if support .Py_GIL_DISABLED :
177170 self .assertTrue (_testinternalcapi .has_deferred_refcount (silly_list ))
178171
You can’t perform that action at this time.
0 commit comments