File tree Expand file tree Collapse file tree 1 file changed +9
-3
lines changed
Lib/test/test_concurrent_futures Expand file tree Collapse file tree 1 file changed +9
-3
lines changed Original file line number Diff line number Diff line change @@ -282,6 +282,15 @@ def test_idle_thread_reuse(self):
282
282
283
283
class AsyncioTest (InterpretersMixin , testasyncio_utils .TestCase ):
284
284
285
+ @classmethod
286
+ def setUpClass (cls ):
287
+ policy = support .maybe_get_event_loop_policy ()
288
+ assert policy is None , policy
289
+
290
+ @classmethod
291
+ def tearDownClass (cls ):
292
+ asyncio .set_event_loop_policy (None )
293
+
285
294
def setUp (self ):
286
295
super ().setUp ()
287
296
self .loop = asyncio .new_event_loop ()
@@ -290,9 +299,6 @@ def setUp(self):
290
299
self .executor = self .executor_type ()
291
300
self .addCleanup (lambda : self .executor .shutdown ())
292
301
293
- if support .maybe_get_event_loop_policy () is None :
294
- self .addCleanup (lambda : asyncio .set_event_loop_policy (None ))
295
-
296
302
def tearDown (self ):
297
303
if not self .loop .is_closed ():
298
304
testasyncio_utils .run_briefly (self .loop )
You can’t perform that action at this time.
0 commit comments