diff --git a/.coveragerc b/.coveragerc index 8ade81af9..40692fe48 100644 --- a/.coveragerc +++ b/.coveragerc @@ -1,4 +1,6 @@ -[run] -omit = +[report] +omit = baybe/utils/plotting.py + baybe/utils/random.py + baybe/utils/botorch_wrapper.py baybe/simulation/* \ No newline at end of file diff --git a/tests/docs/test_examples.py b/tests/docs/test_examples.py index e73e49e7d..ad24d1a18 100644 --- a/tests/docs/test_examples.py +++ b/tests/docs/test_examples.py @@ -1,7 +1,7 @@ """Test if all examples can be run without error.""" import os -import runpy +import subprocess from pathlib import Path import pytest @@ -22,8 +22,13 @@ ) @pytest.mark.parametrize("example", paths, ids=paths) def test_example(example: str): - """Test an individual example by running it.""" - runpy.run_path(example) + """Test an individual example by running it. + + This runs in a separate process and isolated environment due to problems caused by + monkeypatching in some examples affecting other tests if they were executed in the + same environment. + """ + subprocess.run(["python", example], check=True) if _SMOKE_TEST_CACHE is not None: