From ef5fb21130dcdbaeed57aa7c9275452012675167 Mon Sep 17 00:00:00 2001 From: martinRenou Date: Fri, 23 Sep 2022 13:54:21 +0200 Subject: [PATCH] Revert "Fix CI (#1193)" This reverts commit 249b0770773ee436b01bedbbfb339cd195b4cc53. --- tests/app/preheat_multiple_notebooks_test.py | 2 +- tests/execute_output_test.py | 21 ++++-------- tests/notebooks/output.ipynb | 36 ++++++-------------- 3 files changed, 17 insertions(+), 42 deletions(-) diff --git a/tests/app/preheat_multiple_notebooks_test.py b/tests/app/preheat_multiple_notebooks_test.py index 5ef2b8cde..4ee68313f 100644 --- a/tests/app/preheat_multiple_notebooks_test.py +++ b/tests/app/preheat_multiple_notebooks_test.py @@ -4,7 +4,7 @@ import os BASE_DIR = os.path.dirname(__file__) -NOTEBOOK_EXECUTION_TIME = 3 +NOTEBOOK_EXECUTION_TIME = 2 NUMBER_PREHEATED_KERNEL = 2 TIME_THRESHOLD = 1 diff --git a/tests/execute_output_test.py b/tests/execute_output_test.py index 4220cb839..963727b56 100644 --- a/tests/execute_output_test.py +++ b/tests/execute_output_test.py @@ -25,9 +25,7 @@ def normalize_output(output): if 'traceback' in output: del output['traceback'] if 'application/vnd.jupyter.widget-view+json' in output.get('data', {}): - output['data']['application/vnd.jupyter.widget-view+json'][ - 'model_id' - ] = '' + output['data']['application/vnd.jupyter.widget-view+json']['model_id'] = '' def normalize_outputs(outputs): @@ -36,31 +34,24 @@ def normalize_outputs(outputs): def test_execute_output(): - path = os.path.join(BASE_DIR, 'notebooks/output.ipynb') + path = os.path.join(BASE_DIR, "notebooks/output.ipynb") nb = read(path, NO_CONVERT) nb_voila = deepcopy(nb) executenb(nb_voila) widget_states = nb.metadata.widgets[WIDGET_MIME_TYPE_STATE]['state'] - widget_states_voila = nb_voila.metadata.widgets[WIDGET_MIME_TYPE_STATE][ - 'state' - ] + widget_states_voila = nb_voila.metadata.widgets[WIDGET_MIME_TYPE_STATE]['state'] for cell_voila, cell in zip(nb_voila.cells, nb.cells): for output_voila, output in zip(cell_voila.outputs, cell.outputs): if 'data' in output and WIDGET_MIME_TYPE_VIEW in output['data']: widget_id = output['data'][WIDGET_MIME_TYPE_VIEW]['model_id'] - widget_id_voila = output_voila['data'][WIDGET_MIME_TYPE_VIEW][ - 'model_id' - ] + widget_id_voila = output_voila['data'][WIDGET_MIME_TYPE_VIEW]['model_id'] widget_state = widget_states[widget_id] widget_state_voila = widget_states_voila[widget_id_voila] # if the widget is an output widget, it has the outputs, which we also check - assert normalize_outputs( - widget_state.state.get('outputs', []) - ) == normalize_outputs( - widget_state_voila.state.get('outputs', []) - ) + assert normalize_outputs(widget_state.state.get('outputs', [])) ==\ + normalize_outputs(widget_state_voila.state.get('outputs', [])) normalize_output(output_voila) normalize_output(output) assert output_voila == output diff --git a/tests/notebooks/output.ipynb b/tests/notebooks/output.ipynb index 791436dce..8c8851a39 100644 --- a/tests/notebooks/output.ipynb +++ b/tests/notebooks/output.ipynb @@ -16,9 +16,8 @@ "Output()" ] }, - "execution_count": 1, "metadata": {}, - "output_type": "execute_result" + "output_type": "display_data" } ], "source": [ @@ -73,9 +72,8 @@ "Output()" ] }, - "execution_count": 4, "metadata": {}, - "output_type": "execute_result" + "output_type": "display_data" } ], "source": [ @@ -120,9 +118,8 @@ "Output()" ] }, - "execution_count": 6, "metadata": {}, - "output_type": "execute_result" + "output_type": "display_data" } ], "source": [ @@ -168,9 +165,8 @@ "Output()" ] }, - "execution_count": 8, "metadata": {}, - "output_type": "execute_result" + "output_type": "display_data" } ], "source": [ @@ -215,9 +211,8 @@ "Output()" ] }, - "execution_count": 10, "metadata": {}, - "output_type": "execute_result" + "output_type": "display_data" } ], "source": [ @@ -254,9 +249,8 @@ "Output()" ] }, - "execution_count": 12, "metadata": {}, - "output_type": "execute_result" + "output_type": "display_data" } ], "source": [ @@ -282,9 +276,8 @@ "Output()" ] }, - "execution_count": 13, "metadata": {}, - "output_type": "execute_result" + "output_type": "display_data" } ], "source": [ @@ -303,20 +296,11 @@ " print('in outer')\n", " print('also in inner')" ] - }, - { - "cell_type": "code", - "execution_count": null, - "metadata": {}, - "outputs": [], - "source": [] } ], "metadata": { "kernelspec": { - "display_name": "Python 3 (ipykernel)", - "language": "python", - "name": "python3" + "language": "python" }, "language_info": { "codemirror_mode": { @@ -328,7 +312,7 @@ "name": "python", "nbconvert_exporter": "python", "pygments_lexer": "ipython3", - "version": "3.9.13" + "version": "3.7.3" }, "widgets": { "application/vnd.jupyter.widget-state+json": { @@ -788,5 +772,5 @@ } }, "nbformat": 4, - "nbformat_minor": 4 + "nbformat_minor": 2 }