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 @@ -2698,17 +2698,17 @@ def __str__(self):
26982698 initial_refcount = sys .getrefcount (obj )
26992699
27002700 coro = coroutine_function ()
2701- loop = asyncio .new_event_loop ()
2702- task = asyncio .Task .__new__ (asyncio .Task )
2701+ with contextlib . closing ( asyncio .EventLoop ()) as loop :
2702+ task = asyncio .Task .__new__ (asyncio .Task )
27032703
2704- for _ in range (5 ):
2705- with self .assertRaisesRegex (RuntimeError , 'break' ):
2706- task .__init__ (coro , loop = loop , context = obj , name = Break ())
2704+ for _ in range (5 ):
2705+ with self .assertRaisesRegex (RuntimeError , 'break' ):
2706+ task .__init__ (coro , loop = loop , context = obj , name = Break ())
27072707
2708- coro .close ()
2709- del task
2708+ coro .close ()
2709+ del task
27102710
2711- self .assertEqual (sys .getrefcount (obj ), initial_refcount )
2711+ self .assertEqual (sys .getrefcount (obj ), initial_refcount )
27122712
27132713
27142714def add_subclass_tests (cls ):
You can’t perform that action at this time.
0 commit comments