From b051746c81fe001fcc11206acbe6a487d11a1501 Mon Sep 17 00:00:00 2001 From: birgits Date: Fri, 12 Jan 2024 10:12:57 -0800 Subject: [PATCH] Try fixing import error of example.modelchain_example when notebooks are run on github --- example/test_examples.py | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/example/test_examples.py b/example/test_examples.py index 30d7610..1cd7491 100644 --- a/example/test_examples.py +++ b/example/test_examples.py @@ -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,