Skip to content

Commit

Permalink
FIX: Gracefully allow missing addoptions with --pyargs
Browse files Browse the repository at this point in the history
  • Loading branch information
effigies committed Dec 14, 2022
1 parent 57d0dbf commit 890f5de
Showing 1 changed file with 12 additions and 3 deletions.
15 changes: 12 additions & 3 deletions pydra/conftest.py
Original file line number Diff line number Diff line change
Expand Up @@ -15,12 +15,21 @@ def pytest_generate_tests(metafunc):
Plugins = ["slurm"]
else:
Plugins = ["cf"]
if metafunc.config.getoption("dask"):
Plugins.append("dask")
try:
if metafunc.config.getoption("dask"):
Plugins.append("dask")
except ValueError:
# Called as --pyargs, so --dask isn't available
pass
metafunc.parametrize("plugin_dask_opt", Plugins)

if "plugin" in metafunc.fixturenames:
if metafunc.config.getoption("dask"):
use_dask = False
try:
use_dask = metafunc.config.getoption("dask")
except ValueError:
pass
if use_dask:
Plugins = []
elif bool(shutil.which("sbatch")):
Plugins = ["slurm"]
Expand Down

0 comments on commit 890f5de

Please sign in to comment.