Skip to content

Commit

Permalink
Readthedocs: Don't let notebook failures pass silently
Browse files Browse the repository at this point in the history
Adds both to conf.py:

nb_execution_allow_errors = False
nb_execution_raise_on_error = True

To make sure that when one of the (tutorial) notebooks fails, the Readthedocs also fails and doesn't continue silently.

See https://myst-nb.readthedocs.io/en/latest/computation/execute.html#error-reporting-warning-vs-failure
  • Loading branch information
EwoutH committed Sep 4, 2024
1 parent 3d19edc commit ca8b6d3
Show file tree
Hide file tree
Showing 2 changed files with 12 additions and 5 deletions.
2 changes: 2 additions & 0 deletions docs/conf.py
Original file line number Diff line number Diff line change
Expand Up @@ -113,6 +113,8 @@

nb_execution_timeout = 60
nb_execution_mode = "cache"
nb_execution_allow_errors = False
nb_execution_raise_on_error = True

# -- Options for HTML output ----------------------------------------------

Expand Down
15 changes: 10 additions & 5 deletions docs/tutorials/intro_tutorial.ipynb
Original file line number Diff line number Diff line change
Expand Up @@ -90,15 +90,19 @@
},
{
"cell_type": "code",
"execution_count": null,
"metadata": {},
"outputs": [],
"metadata": {
"jupyter": {
"is_executing": true
}
},
"source": [
"# SKIP THIS CELL unless running in colab\n",
"\n",
"%pip install --quiet mesa\n",
"# The exclamation points tell jupyter to do the command via the command line"
]
],
"outputs": [],
"execution_count": null
},
{
"cell_type": "markdown",
Expand Down Expand Up @@ -323,7 +327,8 @@
"outputs": [],
"source": [
"starter_model = MoneyModel(10)\n",
"starter_model.step()"
"starter_model.step()\n",
"starter_model.method_doesnt_exist()"
]
},
{
Expand Down

0 comments on commit ca8b6d3

Please sign in to comment.