File tree Expand file tree Collapse file tree 1 file changed +8
-8
lines changed
Expand file tree Collapse file tree 1 file changed +8
-8
lines changed Original file line number Diff line number Diff line change @@ -2499,17 +2499,17 @@ def __str__(self):
24992499 initial_refcount = sys .getrefcount (obj )
25002500
25012501 coro = coroutine_function ()
2502- loop = asyncio .new_event_loop ()
2503- task = asyncio .Task .__new__ (asyncio .Task )
2502+ with contextlib . closing ( asyncio .EventLoop ()) as loop :
2503+ task = asyncio .Task .__new__ (asyncio .Task )
25042504
2505- for _ in range (5 ):
2506- with self .assertRaisesRegex (RuntimeError , 'break' ):
2507- task .__init__ (coro , loop = loop , context = obj , name = Break ())
2505+ for _ in range (5 ):
2506+ with self .assertRaisesRegex (RuntimeError , 'break' ):
2507+ task .__init__ (coro , loop = loop , context = obj , name = Break ())
25082508
2509- coro .close ()
2510- del task
2509+ coro .close ()
2510+ del task
25112511
2512- self .assertEqual (sys .getrefcount (obj ), initial_refcount )
2512+ self .assertEqual (sys .getrefcount (obj ), initial_refcount )
25132513
25142514
25152515def add_subclass_tests (cls ):
You can’t perform that action at this time.
0 commit comments