File tree Expand file tree Collapse file tree 1 file changed +9
-9
lines changed Expand file tree Collapse file tree 1 file changed +9
-9
lines changed Original file line number Diff line number Diff line change @@ -808,15 +808,15 @@ def worker2(guard):
808808                guard ['MY_VAR' ] =  'value2' 
809809                time .sleep (0.0001 )
810810
811-         guard   =   EnvironmentVarGuard ()
812-         t1  =  threading .Thread (target = worker1 , args = (guard ,))
813-         t2  =  threading .Thread (target = worker2 , args = (guard ,))
814-         t1 .start ()
815-         t2 .start ()
816-         t1 .join ()
817-         t2 .join ()
818-         final_value  =  os .getenv ('MY_VAR' )
819-         self .assertEqual (final_value , " value2"
811+         with   EnvironmentVarGuard ()  as   guard : 
812+              t1  =  threading .Thread (target = worker1 , args = (guard ,))
813+              t2  =  threading .Thread (target = worker2 , args = (guard ,))
814+              t1 .start ()
815+              t2 .start ()
816+              t1 .join ()
817+              t2 .join ()
818+              final_value  =  os .getenv ('MY_VAR' )
819+              self .assertIn (final_value , ( "value1" ,  " value2") )
820820
821821
822822    # XXX -follows a list of untested API 
 
 
   
 
     
   
   
          
    
    
     
    
      
     
     
    You can’t perform that action at this time.
  
 
    
  
    
      
        
     
       
      
     
   
 
    
    
  
 
  
 
     
    
0 commit comments