Skip to content

Commit

Permalink
- fixed renamed argument;
Browse files Browse the repository at this point in the history
  • Loading branch information
jaltmayerpizzorno committed May 28, 2024
1 parent 031bb4b commit 0d1facd
Showing 1 changed file with 14 additions and 12 deletions.
26 changes: 14 additions & 12 deletions src/pytest_cleanslate/reduce.py
Original file line number Diff line number Diff line change
Expand Up @@ -239,11 +239,12 @@ def main():
failed = results.get_first_failed()
if failed is None:
print("No tests failed!", flush=True)
with args.to.open("w") as f:
json.dump({
'failed': failed,
'error': 'No tests failed',
}, f)
if args.save_to:
with args.save_to.open("w") as f:
json.dump({
'failed': failed,
'error': 'No tests failed',
}, f)
return 1

is_module = results.is_module(failed)
Expand All @@ -262,11 +263,12 @@ def main():

if solo.get_outcome(failed) != 'passed':
print("That also fails by itself!", flush=True)
with args.to.open("w") as f:
json.dump({
'failed': failed,
'error': f'{"Module" if is_module else "Test"} also fails by itself',
}, f)
if args.save_to:
with args.save_to.open("w") as f:
json.dump({
'failed': failed,
'error': f'{"Module" if is_module else "Test"} also fails by itself',
}, f)
return 1

tests = results.get_tests()
Expand All @@ -290,8 +292,8 @@ def main():
print(f" tests: {tests}")
print(flush=True)

if args.to:
with args.to.open("w") as f:
if args.save_to:
with args.save_to.open("w") as f:
json.dump({
'failed': failed,
'modules': modules,
Expand Down

0 comments on commit 0d1facd

Please sign in to comment.