From 93ec9e4aa29433e71defe069554e347e87888976 Mon Sep 17 00:00:00 2001 From: Kristian Zarebski Date: Mon, 10 Aug 2020 18:05:06 +0100 Subject: [PATCH] Added examples test file --- tests/test_examples.py | 9 +++++++++ 1 file changed, 9 insertions(+) create mode 100644 tests/test_examples.py diff --git a/tests/test_examples.py b/tests/test_examples.py new file mode 100644 index 0000000..42a95a9 --- /dev/null +++ b/tests/test_examples.py @@ -0,0 +1,9 @@ +import subprocess +import glob +import os + +def test_examples(): + loc_dir = os.path.realpath(__file__).replace(os.path.basename(__file__), '') + examples = glob.glob(os.path.join(loc_dir, '..', 'examples', '*.py')) + for ex in examples: + assert not subprocess.check_call(f'python {ex}', shell=True)