File tree Expand file tree Collapse file tree
packages/bigframes/tests/unit Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -180,14 +180,10 @@ def test_page_size_change_resets_sort(mock_df):
180180def test_cell_execution_count_propagation (mock_df ):
181181 """Test that the captured cell_execution_count is propagated to to_pandas_batches."""
182182 with mock .patch (
183- "IPython .core.interactiveshell.InteractiveShell.initialized " , return_value = True
183+ "bigframes .core.utils.get_ipython_execution_count " , return_value = 42
184184 ):
185- with mock .patch (
186- "IPython.core.interactiveshell.InteractiveShell.instance"
187- ) as mock_instance :
188- mock_instance .return_value .execution_count = 42
189- with bigframes .option_context ("display.render_mode" , "anywidget" ):
190- widget = TableWidget (mock_df )
185+ with bigframes .option_context ("display.render_mode" , "anywidget" ):
186+ widget = TableWidget (mock_df )
191187
192188 assert widget ._cell_execution_count == 42
193189
Original file line number Diff line number Diff line change @@ -208,13 +208,9 @@ def test_execution_history_filters_by_notebook_cell_when_all_cells_is_false():
208208 session ._metrics .jobs .extend ([job1 , job2 ])
209209
210210 with mock .patch (
211- "IPython .core.interactiveshell.InteractiveShell.initialized " , return_value = True
211+ "bigframes .core.utils.get_ipython_execution_count " , return_value = 20
212212 ):
213- with mock .patch (
214- "IPython.core.interactiveshell.InteractiveShell.instance"
215- ) as mock_instance :
216- mock_instance .return_value .execution_count = 20
217- history = session .execution_history (all_cells = False ).to_dataframe ()
213+ history = session .execution_history (all_cells = False ).to_dataframe ()
218214
219215 assert len (history ) == 1
220216 assert history .iloc [0 ]["job_id" ] == "job_2"
You can’t perform that action at this time.
0 commit comments