Skip to content

Commit 70fa37b

Browse files
committed
Revert "Fix CI (voila-dashboards#1193)"
This reverts commit 249b077.
1 parent 588d63a commit 70fa37b

File tree

3 files changed

+17
-42
lines changed

3 files changed

+17
-42
lines changed

tests/app/preheat_multiple_notebooks_test.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@
44
import os
55

66
BASE_DIR = os.path.dirname(__file__)
7-
NOTEBOOK_EXECUTION_TIME = 3
7+
NOTEBOOK_EXECUTION_TIME = 2
88
NUMBER_PREHEATED_KERNEL = 2
99
TIME_THRESHOLD = 1
1010

tests/execute_output_test.py

Lines changed: 6 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -25,9 +25,7 @@ def normalize_output(output):
2525
if 'traceback' in output:
2626
del output['traceback']
2727
if 'application/vnd.jupyter.widget-view+json' in output.get('data', {}):
28-
output['data']['application/vnd.jupyter.widget-view+json'][
29-
'model_id'
30-
] = '<MODEL_ID>'
28+
output['data']['application/vnd.jupyter.widget-view+json']['model_id'] = '<MODEL_ID>'
3129

3230

3331
def normalize_outputs(outputs):
@@ -36,31 +34,24 @@ def normalize_outputs(outputs):
3634

3735

3836
def test_execute_output():
39-
path = os.path.join(BASE_DIR, 'notebooks/output.ipynb')
37+
path = os.path.join(BASE_DIR, "notebooks/output.ipynb")
4038
nb = read(path, NO_CONVERT)
4139
nb_voila = deepcopy(nb)
4240
executenb(nb_voila)
4341

4442
widget_states = nb.metadata.widgets[WIDGET_MIME_TYPE_STATE]['state']
45-
widget_states_voila = nb_voila.metadata.widgets[WIDGET_MIME_TYPE_STATE][
46-
'state'
47-
]
43+
widget_states_voila = nb_voila.metadata.widgets[WIDGET_MIME_TYPE_STATE]['state']
4844

4945
for cell_voila, cell in zip(nb_voila.cells, nb.cells):
5046
for output_voila, output in zip(cell_voila.outputs, cell.outputs):
5147
if 'data' in output and WIDGET_MIME_TYPE_VIEW in output['data']:
5248
widget_id = output['data'][WIDGET_MIME_TYPE_VIEW]['model_id']
53-
widget_id_voila = output_voila['data'][WIDGET_MIME_TYPE_VIEW][
54-
'model_id'
55-
]
49+
widget_id_voila = output_voila['data'][WIDGET_MIME_TYPE_VIEW]['model_id']
5650
widget_state = widget_states[widget_id]
5751
widget_state_voila = widget_states_voila[widget_id_voila]
5852
# if the widget is an output widget, it has the outputs, which we also check
59-
assert normalize_outputs(
60-
widget_state.state.get('outputs', [])
61-
) == normalize_outputs(
62-
widget_state_voila.state.get('outputs', [])
63-
)
53+
assert normalize_outputs(widget_state.state.get('outputs', [])) ==\
54+
normalize_outputs(widget_state_voila.state.get('outputs', []))
6455
normalize_output(output_voila)
6556
normalize_output(output)
6657
assert output_voila == output

tests/notebooks/output.ipynb

Lines changed: 10 additions & 26 deletions
Original file line numberDiff line numberDiff line change
@@ -16,9 +16,8 @@
1616
"Output()"
1717
]
1818
},
19-
"execution_count": 1,
2019
"metadata": {},
21-
"output_type": "execute_result"
20+
"output_type": "display_data"
2221
}
2322
],
2423
"source": [
@@ -73,9 +72,8 @@
7372
"Output()"
7473
]
7574
},
76-
"execution_count": 4,
7775
"metadata": {},
78-
"output_type": "execute_result"
76+
"output_type": "display_data"
7977
}
8078
],
8179
"source": [
@@ -120,9 +118,8 @@
120118
"Output()"
121119
]
122120
},
123-
"execution_count": 6,
124121
"metadata": {},
125-
"output_type": "execute_result"
122+
"output_type": "display_data"
126123
}
127124
],
128125
"source": [
@@ -168,9 +165,8 @@
168165
"Output()"
169166
]
170167
},
171-
"execution_count": 8,
172168
"metadata": {},
173-
"output_type": "execute_result"
169+
"output_type": "display_data"
174170
}
175171
],
176172
"source": [
@@ -215,9 +211,8 @@
215211
"Output()"
216212
]
217213
},
218-
"execution_count": 10,
219214
"metadata": {},
220-
"output_type": "execute_result"
215+
"output_type": "display_data"
221216
}
222217
],
223218
"source": [
@@ -254,9 +249,8 @@
254249
"Output()"
255250
]
256251
},
257-
"execution_count": 12,
258252
"metadata": {},
259-
"output_type": "execute_result"
253+
"output_type": "display_data"
260254
}
261255
],
262256
"source": [
@@ -282,9 +276,8 @@
282276
"Output()"
283277
]
284278
},
285-
"execution_count": 13,
286279
"metadata": {},
287-
"output_type": "execute_result"
280+
"output_type": "display_data"
288281
}
289282
],
290283
"source": [
@@ -303,20 +296,11 @@
303296
" print('in outer')\n",
304297
" print('also in inner')"
305298
]
306-
},
307-
{
308-
"cell_type": "code",
309-
"execution_count": null,
310-
"metadata": {},
311-
"outputs": [],
312-
"source": []
313299
}
314300
],
315301
"metadata": {
316302
"kernelspec": {
317-
"display_name": "Python 3 (ipykernel)",
318-
"language": "python",
319-
"name": "python3"
303+
"language": "python"
320304
},
321305
"language_info": {
322306
"codemirror_mode": {
@@ -328,7 +312,7 @@
328312
"name": "python",
329313
"nbconvert_exporter": "python",
330314
"pygments_lexer": "ipython3",
331-
"version": "3.9.13"
315+
"version": "3.7.3"
332316
},
333317
"widgets": {
334318
"application/vnd.jupyter.widget-state+json": {
@@ -788,5 +772,5 @@
788772
}
789773
},
790774
"nbformat": 4,
791-
"nbformat_minor": 4
775+
"nbformat_minor": 2
792776
}

0 commit comments

Comments
 (0)