Skip to content

Commit 890f5de

Browse files
committed
FIX: Gracefully allow missing addoptions with --pyargs
1 parent 57d0dbf commit 890f5de

File tree

1 file changed

+12
-3
lines changed

1 file changed

+12
-3
lines changed

pydra/conftest.py

Lines changed: 12 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -15,12 +15,21 @@ def pytest_generate_tests(metafunc):
1515
Plugins = ["slurm"]
1616
else:
1717
Plugins = ["cf"]
18-
if metafunc.config.getoption("dask"):
19-
Plugins.append("dask")
18+
try:
19+
if metafunc.config.getoption("dask"):
20+
Plugins.append("dask")
21+
except ValueError:
22+
# Called as --pyargs, so --dask isn't available
23+
pass
2024
metafunc.parametrize("plugin_dask_opt", Plugins)
2125

2226
if "plugin" in metafunc.fixturenames:
23-
if metafunc.config.getoption("dask"):
27+
use_dask = False
28+
try:
29+
use_dask = metafunc.config.getoption("dask")
30+
except ValueError:
31+
pass
32+
if use_dask:
2433
Plugins = []
2534
elif bool(shutil.which("sbatch")):
2635
Plugins = ["slurm"]

0 commit comments

Comments
 (0)