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 @@ -2694,17 +2694,17 @@ def __str__(self):
26942694        initial_refcount  =  sys .getrefcount (obj )
26952695
26962696        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 )
26992699
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 ())
27032703
2704-         coro .close ()
2705-         del  task 
2704+              coro .close ()
2705+              del  task 
27062706
2707-         self .assertEqual (sys .getrefcount (obj ), initial_refcount )
2707+              self .assertEqual (sys .getrefcount (obj ), initial_refcount )
27082708
27092709
27102710def  add_subclass_tests (cls ):
    
 
   
 
     
   
   
          
     
  
    
     
 
    
      
     
 
     
    You can’t perform that action at this time.
  
 
    
  
     
    
      
        
     
 
       
      
     
   
 
    
    
  
 
  
 
     
    
0 commit comments