Skip to content

Commit

Permalink
Merge pull request #872 from benoit-pierre/tweak_blackbox_assertion_m…
Browse files Browse the repository at this point in the history
…essage

utils: tweak blackbox test assertion message
  • Loading branch information
morinted authored Dec 4, 2017
2 parents 1c89a32 + e391b70 commit a564116
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 a564116

Please sign in to comment.