Skip to content

Commit

Permalink
simplify code
Browse files Browse the repository at this point in the history
  • Loading branch information
mzuenni committed Feb 15, 2024
1 parent 39aa8c1 commit e21a58c
Showing 1 changed file with 5 additions and 6 deletions.
11 changes: 5 additions & 6 deletions bin/testcase.py
Original file line number Diff line number Diff line change
Expand Up @@ -234,14 +234,13 @@ def validate_format(
ret = validator.run(self, mode=mode, constraints=constraints, args=flags)
if ret.ok == ExecStatus.ERROR:
bar.log(f"Unxpected exit code!")
ok = True if ret.ok else False

validator_accepted.append(ok)
message = validator.name + (' accepted' if ok else ' rejected')
validator_accepted.append(True if ret.ok else False)
message = validator.name + (' accepted' if ret.ok else ' rejected')

# Print stdout and stderr whenever something is printed
data = ''
if not (ok or expect_rejection) or config.args.error:
if not (ret.ok or expect_rejection) or config.args.error:
if ret.err and ret.out:
ret.out = (
ret.err
Expand All @@ -262,13 +261,13 @@ def validate_format(
data = ret.err

bar.part_done(
ok or expect_rejection,
ret.ok or expect_rejection,
message,
data=data,
warn_instead_of_error=warn_instead_of_error,
)

if ok:
if ret.ok:
continue

# Move testcase to destination directory if specified.
Expand Down

0 comments on commit e21a58c

Please sign in to comment.