##// END OF EJS Templates
Added fix for display hook call output format
Matthew Seal -
Show More
@@ -317,4 +317,4 b' class CapturingDisplayHook(object):'
317 if result is None:
317 if result is None:
318 return
318 return
319 format_dict, md_dict = self.shell.display_formatter.format(result)
319 format_dict, md_dict = self.shell.display_formatter.format(result)
320 self.outputs.append((format_dict, md_dict))
320 self.outputs.append({ 'data': format_dict, 'metadata': md_dict })
@@ -101,3 +101,11 b' def test_interactivehooks_ast_modes_semi_supress():'
101
101
102 finally:
102 finally:
103 ip.ast_node_interactivity = saved_mode
103 ip.ast_node_interactivity = saved_mode
104
105 def test_capture_display_hook_format():
106 """Tests that the capture display hook conforms to the CapturedIO output format"""
107 hook = CapturingDisplayHook(ip)
108 hook({"foo": "bar"})
109 captured = CapturedIO(sys.stdout, sys.stderr, hook.outputs)
110 # Should not raise with RichOutput transformation error
111 captured.outputs
General Comments 0
You need to be logged in to leave comments. Login now