@@ -36,13 +36,11 @@ def get_test_runner_kwargs(self):
3636
3737 # For single file case we are able to create file here
3838 # But for multiple files case files will be created inside runner/results
39- if single_file is not None :
39+ if single_file is None : # output will be a path (folder)
40+ output = output_dir
41+ else : # output will be a stream
4042 if not os .path .exists (output_dir ):
4143 os .makedirs (output_dir )
42-
43- if single_file is None : # output is a stream
44- output = output_dir
45- else : # output is a folder
4644 file_path = os .path .join (output_dir , single_file )
4745 output = open (file_path , 'wb' )
4846
@@ -55,9 +53,9 @@ def get_test_runner_kwargs(self):
5553 )
5654
5755 def run_suite (self , suite , ** kwargs ):
58- kwargs = self .get_test_runner_kwargs ()
59- runner = self .test_runner (** kwargs )
56+ runner_kwargs = self .get_test_runner_kwargs ()
57+ runner = self .test_runner (** runner_kwargs )
6058 results = runner .run (suite )
61- if hasattr (kwargs ['output' ], 'close' ):
62- kwargs ['output' ].close ()
59+ if hasattr (runner_kwargs ['output' ], 'close' ):
60+ runner_kwargs ['output' ].close ()
6361 return results
0 commit comments