From 5ef1506f7bc0ff2f59e8b6969ed6b5a015d527f4 Mon Sep 17 00:00:00 2001 From: Maike Held Date: Wed, 7 Sep 2022 18:58:16 +0200 Subject: [PATCH 1/2] Added notebook edisgo_documentation_examples.ipynb that is integrated in test_examples.py The notebook will be filled with examples from the documentation to automatically test if the examples work correctly. --- tests/test_examples.py | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/tests/test_examples.py b/tests/test_examples.py index a71c7adcb..9fc5bea65 100644 --- a/tests/test_examples.py +++ b/tests/test_examples.py @@ -75,3 +75,12 @@ def test_plot_example_ipynb(self): # os.path.join(examples_dir_path, "edisgo_simple_example.ipynb") # ) # assert errors == [] + + def test_edisgo_documentation_examples_ipynb(self): + examples_dir_path = os.path.join( + os.path.dirname(os.path.dirname(__file__)), "examples" + ) + nb, errors = self._notebook_run( + os.path.join(examples_dir_path, "edisgo_documentation_examples.ipynb") + ) + assert errors == [] From f2e5f28b612349e51894f28d3fd59d85760843ba Mon Sep 17 00:00:00 2001 From: Maike Held Date: Fri, 9 Sep 2022 08:43:24 +0200 Subject: [PATCH 2/2] Added documentation examples to edisgo_documentation_examples.ipynb notebook Examples from the documentation (Minimum working exampes and Usage details) are now automatically tested within the notebook --- tests/test_examples.py | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/tests/test_examples.py b/tests/test_examples.py index 9fc5bea65..01a178e0e 100644 --- a/tests/test_examples.py +++ b/tests/test_examples.py @@ -38,7 +38,7 @@ def _notebook_run(self, path): "--to", "notebook", "--execute", - "--ExecutePreprocessor.timeout=60", + "--ExecutePreprocessor.timeout=90", ] subprocess.check_call(args) @@ -76,6 +76,7 @@ def test_plot_example_ipynb(self): # ) # assert errors == [] + # @pytest.mark.slow def test_edisgo_documentation_examples_ipynb(self): examples_dir_path = os.path.join( os.path.dirname(os.path.dirname(__file__)), "examples"