File tree 1 file changed +8
-8
lines changed
Filter options
1 file changed +8
-8
lines changed
Original file line number Diff line number Diff line change @@ -2694,17 +2694,17 @@ def __str__(self):
2694
2694
initial_refcount = sys .getrefcount (obj )
2695
2695
2696
2696
coro = coroutine_function ()
2697
- loop = asyncio .new_event_loop ()
2698
- task = asyncio .Task .__new__ (asyncio .Task )
2697
+ with contextlib . closing ( asyncio .EventLoop ()) as loop :
2698
+ task = asyncio .Task .__new__ (asyncio .Task )
2699
2699
2700
- for _ in range (5 ):
2701
- with self .assertRaisesRegex (RuntimeError , 'break' ):
2702
- task .__init__ (coro , loop = loop , context = obj , name = Break ())
2700
+ for _ in range (5 ):
2701
+ with self .assertRaisesRegex (RuntimeError , 'break' ):
2702
+ task .__init__ (coro , loop = loop , context = obj , name = Break ())
2703
2703
2704
- coro .close ()
2705
- del task
2704
+ coro .close ()
2705
+ del task
2706
2706
2707
- self .assertEqual (sys .getrefcount (obj ), initial_refcount )
2707
+ self .assertEqual (sys .getrefcount (obj ), initial_refcount )
2708
2708
2709
2709
2710
2710
def add_subclass_tests (cls ):
You can’t perform that action at this time.
0 commit comments