From: Debian Science Team Date: Thu, 10 Aug 2023 14:23:24 +0000 (+0200) Subject: test_controls X-Git-Tag: archive/raspbian/2019.2.0_git20200924.c27eb18+dfsg1-10+rpi1^2~6 X-Git-Url: https://dgit.raspbian.org/?a=commitdiff_plain;h=783ec85211c40f90d523ac93f4a40d18e6a6ef80;p=mshr.git test_controls Gbp-Pq: Name test_controls.diff --- diff --git a/demo/python/test.py b/demo/python/test.py new file mode 100644 index 0000000..a723c70 --- /dev/null +++ b/demo/python/test.py @@ -0,0 +1,27 @@ +import os +import pathlib +import subprocess +import sys +import pytest + + +# Get directory of this file +dir_path = pathlib.Path(__file__).resolve().parent + +# Build list of demo programs +demos = [] +for subdir in ['.']: + p = pathlib.Path(dir_path, subdir) + demo_files = list(p.glob('*.py')) + for f in demo_files: + demos.append((f.parent, f.name)) + + +@pytest.mark.parametrize("path,name", demos) +def test_demos(path, name): + + # Run in serial + ret = subprocess.run([sys.executable, name], + cwd=str(path), + env={**os.environ, 'MPLBACKEND': 'agg'}, + check=True) diff --git a/test/test.py b/test/test.py new file mode 100644 index 0000000..8b87deb --- /dev/null +++ b/test/test.py @@ -0,0 +1,30 @@ +import os +import pathlib +import subprocess +import sys +import pytest + + +# Get directory of this file +dir_path = pathlib.Path(__file__).resolve().parent + +# Build list of demo programs +tests = [] +for subdir in ['.']: + p = pathlib.Path(dir_path, subdir) + test_files = list(p.glob('**/*.py')) + for f in test_files: + tests.append((f.parent, f.name)) + + +# remove tests that are known to break +tests = [d for d in tests if d[1] not in ''] + + +@pytest.mark.parametrize("path,name", tests) +def test_demos(path, name): + + ret = subprocess.run([sys.executable, name], + cwd=str(path), + env={**os.environ, 'MPLBACKEND': 'agg'}, + check=True)