Skip to content

Commit ffaf45a

Browse files
[minor] add error if --n-workers is given and scheduler not in [shell,slurm]
1 parent 335d875 commit ffaf45a

File tree

1 file changed

+1
-0
lines changed

1 file changed

+1
-0
lines changed

pytest_parallel/plugin.py

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -107,6 +107,7 @@ def pytest_configure(config):
107107
detach = config.getoption('detach')
108108
if not scheduler in ['slurm', 'shell']:
109109
assert not is_worker, f'Internal pytest_parallel error `--_worker` not available with`--scheduler={scheduler}`'
110+
assert not n_workers, f'pytest_parallel error `--n-workers` not available with`--scheduler={scheduler}`. Launch with `mpirun -np {n_workers}` to run in parallel'
110111
if scheduler in ['slurm', 'shell'] and not is_worker:
111112
if n_workers is None:
112113
raise PytestParallelError(f'You need to specify `--n-workers` when `--scheduler={scheduler}`')

0 commit comments

Comments
 (0)