File tree 1 file changed +3
-10
lines changed
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):
134
134
_testcapi .pyobject_clear_weakrefs_no_callbacks (obj )
135
135
136
136
137
+ @threading_helper .requires_working_threading ()
137
138
class EnableDeferredRefcountingTest (unittest .TestCase ):
138
139
"""Test PyUnstable_Object_EnableDeferredRefcount"""
139
140
@support .requires_resource ("cpu" )
@@ -158,21 +159,13 @@ def silly_func(obj):
158
159
159
160
silly_list = [1 , 2 , 3 ]
160
161
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 )
162
163
]
163
164
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 ):
168
166
for i in range (10 ):
169
167
silly_list .append (i )
170
168
171
- for t in threads :
172
- t .join ()
173
-
174
- self .assertIsNone (cm .exc_value )
175
-
176
169
if support .Py_GIL_DISABLED :
177
170
self .assertTrue (_testinternalcapi .has_deferred_refcount (silly_list ))
178
171
You can’t perform that action at this time.
0 commit comments