@@ -26,7 +26,8 @@ def test_elapsed_time(self, mock_stdout):
2626 f .write ("Some log entry\n " )
2727 f .write ("Elapsed time: 01:30:00[h:]min:sec.\n " )
2828 # call the script with the test log file
29- sys .argv = ["./genElapsedTime.py" , "--logDir" , str (self .tmp_dir .name )]
29+ sys .argv = ["./genElapsedTime.py" , "--logDir" , str (self .tmp_dir .name ),
30+ "--noHeader" ]
3031 with patch .object (sys , 'argv' , sys .argv ):
3132 module = importlib .import_module (self .module_name )
3233 # check if output is correct
@@ -40,7 +41,8 @@ def test_zero_time(self, mock_stdout):
4041 f .write ("Some log entry\n " )
4142 f .write ("Elapsed time: 00:00:74[h:]min:sec.\n " )
4243 # call the script with the test log file
43- sys .argv = ["./genElapsedTime.py" , "--logDir" , str (self .tmp_dir .name )]
44+ sys .argv = ["./genElapsedTime.py" , "--logDir" , str (self .tmp_dir .name ),
45+ "--noHeader" ]
4446 with patch .object (sys , 'argv' , sys .argv ):
4547 module = importlib .import_module (self .module_name )
4648 # check if output is correct
@@ -53,7 +55,8 @@ def test_elapsed_time_longer_duration(self, mock_stdout):
5355 f .write ("Some log entry\n " )
5456 f .write ("Elapsed time: 12:24.14[h:]min:sec. CPU time: user 5081.82 sys 170.18 (705%). Peak memory: 9667132KB.\n " )
5557 # call the script with the test log file
56- sys .argv = ["util/genElapsedTime.py" , "--logDir" , str (self .tmp_dir .name )]
58+ sys .argv = ["util/genElapsedTime.py" , "--logDir" , str (self .tmp_dir .name ),
59+ "--noHeader" ]
5760 with patch .object (sys , 'argv' , sys .argv ):
5861 module = importlib .import_module (self .module_name )
5962 importlib .reload (module )
@@ -72,7 +75,9 @@ def test_missing_arg(self):
7275 def test_no_elapsed_time (self ):
7376 with open (self .log_file , "w" ) as f :
7477 f .write ('Other log message' )
75- with patch ('sys.argv' , ["util/genElapsedTime.py" , "--logDir" , str (self .tmp_dir .name )]):
78+ with patch ('sys.argv' , ["util/genElapsedTime.py" ,
79+ "--logDir" , str (self .tmp_dir .name ),
80+ "--noHeader" ]):
7681 with patch ('sys.stderr' , new = StringIO ()) as fake_err_output :
7782 module = importlib .import_module (self .module_name )
7883 importlib .reload (module )
0 commit comments