Skip to content

Commit

Permalink
Fix scripts test stability (#4849)
Browse files Browse the repository at this point in the history
* Fix the stability of the scripts test and fix IDE warnings

* Bug fix
  • Loading branch information
kratman authored Feb 16, 2025
1 parent 9e509db commit 86b00ce
Showing 1 changed file with 6 additions and 5 deletions.
11 changes: 6 additions & 5 deletions tests/test_scripts.py
Original file line number Diff line number Diff line change
Expand Up @@ -7,16 +7,17 @@
ROOT_DIR = Path(__file__).parent.parent


def list_of_files():
file_list = (ROOT_DIR / "examples" / "scripts").rglob("*.py")
return [pytest.param(file, id=file.name) for file in file_list]


class TestExamples:
"""
A class to test the example scripts.
"""

def list_of_files():
file_list = (ROOT_DIR / "examples" / "scripts").rglob("*.py")
return [pytest.param(file, id=file.name) for file in file_list]

@pytest.mark.parametrize("files", list_of_files())
@pytest.mark.scripts
def test_example_scripts(self, files):
runpy.run_path(files)
runpy.run_path(str(files))

0 comments on commit 86b00ce

Please sign in to comment.