From 5db737d3688cfc99fbdd132742573f6d91cb7c6e Mon Sep 17 00:00:00 2001 From: Tyler Goodlet Date: Sun, 17 Jan 2021 21:24:56 -0500 Subject: [PATCH] Run parallel examples --- tests/test_docs_examples.py | 16 ++++++++-------- 1 file changed, 8 insertions(+), 8 deletions(-) diff --git a/tests/test_docs_examples.py b/tests/test_docs_examples.py index ea676a2..3778e0e 100644 --- a/tests/test_docs_examples.py +++ b/tests/test_docs_examples.py @@ -78,13 +78,13 @@ def run_example_in_subproc(loglevel, testdir, arb_addr): @pytest.mark.parametrize( 'example_script', - [ - f for f in os.listdir(examples_dir()) - if ( - ('__' not in f) and - ('debugging' not in f) - ) - ], + + # walk yields: (dirpath, dirnames, filenames) + [(p[0], f) for p in os.walk(examples_dir()) for f in p[2] + + if '__' not in f + and 'debugging' not in p[0] + ] ) def test_example(run_example_in_subproc, example_script): """Load and run scripts from this repo's ``examples/`` dir as a user @@ -95,7 +95,7 @@ def test_example(run_example_in_subproc, example_script): test directory and invoke the script as a module with ``python -m test_example``. """ - ex_file = os.path.join(examples_dir(), example_script) + ex_file = os.path.join(*example_script) with open(ex_file, 'r') as ex: code = ex.read()