Skip to content

Commit

Permalink
Fix error on error in usecase testing
Browse files Browse the repository at this point in the history
  • Loading branch information
andsens committed May 28, 2024
1 parent a3e0d0d commit 8775ce6
Showing 1 changed file with 6 additions and 5 deletions.
11 changes: 6 additions & 5 deletions tests/test_usecases.py
Original file line number Diff line number Diff line change
Expand Up @@ -36,11 +36,12 @@ def run_usecase(monkeypatch, capsys, usecase, bash):
result = {}
if err != '':
result = 'Errors encountered while running usecase %s:%d: %s' % (file, lineno, err)
if out != '':
for line in out.split('\n'):
if expr.match(line) is None:
raise Exception('Unable to match output for usecase %s:%d: %s' % (file, lineno, line))
result[expr.match(line).group(2)] = line # type: ignore
else:
if out != '':
for line in out.split('\n'):
if expr.match(line) is None:
raise Exception('Unable to match output for usecase %s:%d: %s' % (file, lineno, line))
result[expr.match(line).group(2)] = line # type: ignore
else:
result = 'user-error'
return Usecase(file, lineno, bash[0], doc, prog, argv, type, result)
Expand Down

0 comments on commit 8775ce6

Please sign in to comment.