File tree Expand file tree Collapse file tree 2 files changed +9
-0
lines changed Expand file tree Collapse file tree 2 files changed +9
-0
lines changed Original file line number Diff line number Diff line change 1010import  pathlib 
1111import  py_compile 
1212import  re 
13+ import  sys 
1314
1415import  pytest 
1516
2627class  RunFileTest (CoverageTest ):
2728    """Test cases for `run_python_file`.""" 
2829
30+     @pytest .fixture (autouse = True ) 
31+     def  clean_up (self ):
32+         """These tests all run in-process. Clean up global changes.""" 
33+         yield 
34+         sys .excepthook  =  sys .__excepthook__ 
35+ 
2936    def  test_run_python_file (self ):
3037        run_python_file ([TRY_EXECFILE , "arg1" , "arg2" ])
3138        mod_globs  =  json .loads (self .stdout ())
Original file line number Diff line number Diff line change @@ -1092,6 +1092,8 @@ def test_bug_909(self):
10921092class  ExcepthookTest (CoverageTest ):
10931093    """Tests of sys.excepthook support.""" 
10941094
1095+     # TODO: do we need these as process tests if we have test_execfile.py:RunFileTest? 
1096+ 
10951097    def  test_excepthook (self ):
10961098        self .make_file ("excepthook.py" , """\  
10971099
 
 
   
 
     
   
   
          
    
    
     
    
      
     
     
    You can’t perform that action at this time.
  
 
    
  
    
      
        
     
       
      
     
   
 
    
    
  
 
  
 
     
    
0 commit comments