forked from goodboy/tractor
1
0
Fork 0

Run parallel examples

eg_worker_poolz
Tyler Goodlet 2021-01-17 21:24:56 -05:00
parent a90a2b8787
commit 07653bc02e
1 changed files with 8 additions and 8 deletions

View File

@ -78,13 +78,13 @@ def run_example_in_subproc(loglevel, testdir, arb_addr):
@pytest.mark.parametrize( @pytest.mark.parametrize(
'example_script', 'example_script',
[
f for f in os.listdir(examples_dir()) # walk yields: (dirpath, dirnames, filenames)
if ( [(p[0], f) for p in os.walk(examples_dir()) for f in p[2]
('__' not in f) and
('debugging' not in f) if '__' not in f
) and 'debugging' not in p[0]
], ]
) )
def test_example(run_example_in_subproc, example_script): def test_example(run_example_in_subproc, example_script):
"""Load and run scripts from this repo's ``examples/`` dir as a user """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 directory and invoke the script as a module with ``python -m
test_example``. 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: with open(ex_file, 'r') as ex:
code = ex.read() code = ex.read()