Skip to content

Commit a5153de

Browse files
committed
Emit content of unexpected stderr
1 parent 3597e0b commit a5153de

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
@@ -437,12 +437,18 @@ def compare_outputs(self, test, ref, skip_compare=None):
437437
)
438438
return False
439439
elif test_keys - ref_keys:
440+
extra_keys = test_keys - ref_keys
440441
self.comparison_traceback.append(
441442
cc.FAIL
442-
+ "Unexpected output fields from running code: %s"
443-
% (test_keys - ref_keys)
443+
+ "Unexpected output fields from running code: %s" % extra_keys
444444
+ cc.ENDC
445-
)
445+
+ "<<<<<<<<<<<< Unexpected content:"
446+
+ "\n".join("%s: %s" % (i, testing_outs[i]) for i in extra_keys)
447+
+ cc.FAIL
448+
+ '>>>>>>>>>>>>'
449+
+ cc.ENDC
450+
)
451+
print('IN STDERR WE GOT: %s' % testing_outs['stderr'])
446452
return False
447453

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

0 commit comments

Comments
 (0)