@@ -36,13 +36,11 @@ def get_test_runner_kwargs(self):
36
36
37
37
# For single file case we are able to create file here
38
38
# 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
40
42
if not os .path .exists (output_dir ):
41
43
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
46
44
file_path = os .path .join (output_dir , single_file )
47
45
output = open (file_path , 'wb' )
48
46
@@ -55,9 +53,9 @@ def get_test_runner_kwargs(self):
55
53
)
56
54
57
55
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 )
60
58
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 ()
63
61
return results
0 commit comments