File tree 1 file changed +8
-8
lines changed
1 file changed +8
-8
lines changed Original file line number Diff line number Diff line change @@ -2698,17 +2698,17 @@ def __str__(self):
2698
2698
initial_refcount = sys .getrefcount (obj )
2699
2699
2700
2700
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 )
2703
2703
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 ())
2707
2707
2708
- coro .close ()
2709
- del task
2708
+ coro .close ()
2709
+ del task
2710
2710
2711
- self .assertEqual (sys .getrefcount (obj ), initial_refcount )
2711
+ self .assertEqual (sys .getrefcount (obj ), initial_refcount )
2712
2712
2713
2713
2714
2714
def add_subclass_tests (cls ):
You can’t perform that action at this time.
0 commit comments