Skip to content

Commit 2836a20

Browse files
Ensure result nb is printed also when raising (#243)
1 parent 2a68cad commit 2836a20

1 file changed

Lines changed: 10 additions & 8 deletions

File tree

clients/python/test/e2e/test_notebooks.py

Lines changed: 10 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -80,14 +80,16 @@ def _papermill_execute_notebook(
8080

8181
output: Path = tmp_path / (tmp_nb.stem + "_output.ipynb")
8282

83-
pm.execute_notebook(
84-
input_path=tmp_nb,
85-
output_path=output,
86-
kernel_name="python3",
87-
parameters=parameters,
88-
execution_timeout=_NOTEBOOK_EXECUTION_TIMEOUT_SECONDS,
89-
)
90-
_pretty_print_cell_outputs(output)
83+
try:
84+
pm.execute_notebook(
85+
input_path=tmp_nb,
86+
output_path=output,
87+
kernel_name="python3",
88+
parameters=parameters,
89+
execution_timeout=_NOTEBOOK_EXECUTION_TIMEOUT_SECONDS,
90+
)
91+
finally:
92+
_pretty_print_cell_outputs(output)
9193
return output
9294

9395

0 commit comments

Comments
 (0)