From 5c189014a07746022f227213cd84afcdccb77b90 Mon Sep 17 00:00:00 2001 From: "Travis F. Collins" Date: Tue, 14 May 2024 17:20:36 -0600 Subject: [PATCH] Fix example test filters Signed-off-by: Travis F. Collins --- tests/test_examples.py | 10 +++++++--- 1 file changed, 7 insertions(+), 3 deletions(-) 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)