diff --git a/tests/test_examples.py b/tests/test_examples.py index 5c1507b..0feab61 100644 --- a/tests/test_examples.py +++ b/tests/test_examples.py @@ -1,4 +1,5 @@ # flake8: noqa +import os import pathlib import runpy @@ -6,9 +7,12 @@ ignore = ["daq2_rx_dt_example.py", "hmc7044_example.ipynb"] -examples_in_dir = pathlib.Path(__file__).parent.parent / "examples" -examples = [str(p) for p in examples_in_dir.glob("*.py")] -examples = [e for e in examples for i in ignore if i not in e] +examples_dir = os.path.join(pathlib.Path(__file__).parent.parent, "examples") +examples_dir = pathlib.Path(examples_dir) +examples = [str(p) for p in examples_dir.glob("*.py")] +filenames = [os.path.basename(i) for i in examples] +filenames = [i for i in filenames if i not in ignore] +examples = [os.path.join(examples_dir, i) for i in filenames] @pytest.mark.parametrize("script", examples)