Skip to content

Commit 4c065a5

Browse files
FabioLuporinigeorgebisbas
authored andcommitted
Emit content of unexpected stderr
1 parent 6dd2eaa commit 4c065a5

File tree

1 file changed

+9
-3
lines changed

1 file changed

+9
-3
lines changed

nbval/plugin.py

+9-3
Original file line numberDiff line numberDiff line change
@@ -481,12 +481,18 @@ def compare_outputs(self, test, ref, skip_compare=None):
481481
)
482482
return False
483483
elif test_keys - ref_keys:
484+
extra_keys = test_keys - ref_keys
484485
self.comparison_traceback.append(
485486
cc.FAIL
486-
+ "Unexpected output fields from running code: %s"
487-
% (test_keys - ref_keys)
487+
+ "Unexpected output fields from running code: %s" % extra_keys
488488
+ cc.ENDC
489-
)
489+
+ "<<<<<<<<<<<< Unexpected content:"
490+
+ "\n".join("%s: %s" % (i, testing_outs[i]) for i in extra_keys)
491+
+ cc.FAIL
492+
+ '>>>>>>>>>>>>'
493+
+ cc.ENDC
494+
)
495+
print('IN STDERR WE GOT: %s' % testing_outs['stderr'])
490496
return False
491497

492498
# If we've got to here, the two dicts must have the same set of keys

0 commit comments

Comments
 (0)