File tree 1 file changed +14
-12
lines changed
1 file changed +14
-12
lines changed Original file line number Diff line number Diff line change @@ -239,11 +239,12 @@ def main():
239
239
failed = results .get_first_failed ()
240
240
if failed is None :
241
241
print ("No tests failed!" , flush = True )
242
- with args .to .open ("w" ) as f :
243
- json .dump ({
244
- 'failed' : failed ,
245
- 'error' : 'No tests failed' ,
246
- }, f )
242
+ if args .save_to :
243
+ with args .save_to .open ("w" ) as f :
244
+ json .dump ({
245
+ 'failed' : failed ,
246
+ 'error' : 'No tests failed' ,
247
+ }, f )
247
248
return 1
248
249
249
250
is_module = results .is_module (failed )
@@ -262,11 +263,12 @@ def main():
262
263
263
264
if solo .get_outcome (failed ) != 'passed' :
264
265
print ("That also fails by itself!" , flush = True )
265
- with args .to .open ("w" ) as f :
266
- json .dump ({
267
- 'failed' : failed ,
268
- 'error' : f'{ "Module" if is_module else "Test" } also fails by itself' ,
269
- }, f )
266
+ if args .save_to :
267
+ with args .save_to .open ("w" ) as f :
268
+ json .dump ({
269
+ 'failed' : failed ,
270
+ 'error' : f'{ "Module" if is_module else "Test" } also fails by itself' ,
271
+ }, f )
270
272
return 1
271
273
272
274
tests = results .get_tests ()
@@ -290,8 +292,8 @@ def main():
290
292
print (f" tests: { tests } " )
291
293
print (flush = True )
292
294
293
- if args .to :
294
- with args .to .open ("w" ) as f :
295
+ if args .save_to :
296
+ with args .save_to .open ("w" ) as f :
295
297
json .dump ({
296
298
'failed' : failed ,
297
299
'modules' : modules ,
You can’t perform that action at this time.
0 commit comments