From e391b7052d8d9dc06d45cfa568ddffd85e2fa23e Mon Sep 17 00:00:00 2001 From: Benoit Pierre Date: Mon, 4 Dec 2017 16:10:31 +0100 Subject: [PATCH] utils: tweak blackbox test assertion message --- plover_build_utils/testing.py | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) diff --git a/plover_build_utils/testing.py b/plover_build_utils/testing.py index ad184c79f..632b04378 100644 --- a/plover_build_utils/testing.py +++ b/plover_build_utils/testing.py @@ -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(':'): @@ -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):