Skip to content

Commit

Permalink
Try fixing import error of example.modelchain_example when notebooks …
Browse files Browse the repository at this point in the history
…are run on github
  • Loading branch information
birgits committed Jan 12, 2024
1 parent bec03ad commit b051746
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion example/test_examples.py
Original file line number Diff line number Diff line change
Expand Up @@ -56,7 +56,9 @@ def _notebook_run(self, path):
Execute a notebook and collect output.
Returns (parsed nb object, execution errors)
"""
notebook = pytest_notebook.notebook.load_notebook(path=path)
dirname, nb_name = os.path.split(path)
os.chdir(dirname)
notebook = pytest_notebook.notebook.load_notebook(path=nb_name)
result = pytest_notebook.execution.execute_notebook(
notebook,
with_coverage=False,
Expand Down

0 comments on commit b051746

Please sign in to comment.