Skip to content

Commit

Permalink
utils: tweak blackbox test assertion message
Browse files Browse the repository at this point in the history
  • Loading branch information
benoit-pierre committed Dec 4, 2017
1 parent 98c459c commit e391b70
Showing 1 changed file with 7 additions and 2 deletions.
9 changes: 7 additions & 2 deletions plover_build_utils/testing.py
Original file line number Diff line number Diff line change
Expand Up @@ -83,8 +83,6 @@ def replay(blackbox, name, test):
for step in re.split('(?<=[^\\\\])\n', instructions):
# Mark current instruction's line.
lnum += 1
msg = name + '\n' + '\n'.join(('> ' if n == lnum else ' ') + l
for n, l in enumerate(lines))
step = step.strip()
# Support for changing some settings on the fly.
if step.startswith(':'):
Expand All @@ -104,6 +102,13 @@ def replay(blackbox, name, test):
blackbox.translator.translate(steno_to_stroke(s))
# Check output.
expected_output = ast.literal_eval(output.strip())
msg = (
name + '\n' +
'\n'.join(('> ' if n == lnum else ' ') + l
for n, l in enumerate(lines)) + '\n' +
' ' + repr(blackbox.output.text) + '\n'
'!= ' + repr(expected_output)
)
assert blackbox.output.text == expected_output, msg

def replay_doc(f):
Expand Down

0 comments on commit e391b70

Please sign in to comment.