File tree Expand file tree Collapse file tree 2 files changed +5
-2
lines changed
Expand file tree Collapse file tree 2 files changed +5
-2
lines changed Original file line number Diff line number Diff line change @@ -131,7 +131,9 @@ def publish( # type:ignore[override]
131131 exec_count -= 1
132132 outputs = getattr (self .shell .history_manager , "outputs" , None )
133133 if outputs is not None :
134- outputs .append (HistoryOutput (output_type = "display_data" , bundle = data ))
134+ outputs .setdefault (exec_count , []).append (
135+ HistoryOutput (output_type = "display_data" , bundle = data )
136+ )
135137 self ._flush_streams ()
136138 if metadata is None :
137139 metadata = {}
Original file line number Diff line number Diff line change @@ -217,7 +217,8 @@ def test_display_stored_in_history(self):
217217 # Mock shell with history manager
218218 mock_shell = MagicMock ()
219219 mock_shell .execution_count = 1
220- mock_shell .history_manager .outputs = {1 : []}
220+ mock_shell .history_manager .outputs = dict ()
221+ mock_shell .display_pub ._in_post_execute = False
221222
222223 self .disp_pub .shell = mock_shell
223224
You can’t perform that action at this time.
0 commit comments