Skip to content

Commit b051746

Browse files
committed
Try fixing import error of example.modelchain_example when notebooks are run on github
1 parent bec03ad commit b051746

File tree

1 file changed

+3
-1
lines changed

1 file changed

+3
-1
lines changed

example/test_examples.py

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -56,7 +56,9 @@ def _notebook_run(self, path):
5656
Execute a notebook and collect output.
5757
Returns (parsed nb object, execution errors)
5858
"""
59-
notebook = pytest_notebook.notebook.load_notebook(path=path)
59+
dirname, nb_name = os.path.split(path)
60+
os.chdir(dirname)
61+
notebook = pytest_notebook.notebook.load_notebook(path=nb_name)
6062
result = pytest_notebook.execution.execute_notebook(
6163
notebook,
6264
with_coverage=False,

0 commit comments

Comments
 (0)