Skip to content

Commit

Permalink
Addition of pytest case coverage of backend and `AnalysisBase.run()…
Browse files Browse the repository at this point in the history
…` using different `n_workers` values (#4768)
  • Loading branch information
talagayev authored Nov 27, 2024
1 parent 7e521de commit abc9806
Showing 1 changed file with 11 additions and 0 deletions.
11 changes: 11 additions & 0 deletions testsuite/MDAnalysisTests/analysis/test_base.py
Original file line number Diff line number Diff line change
Expand Up @@ -121,6 +121,17 @@ def test_incompatible_n_workers(u):
with pytest.raises(ValueError):
FrameAnalysis(u).run(backend=backend, n_workers=3)


def test_n_workers_conflict_raises_value_error(u):
backend_instance = ManyWorkersBackend(n_workers=4)

with pytest.raises(ValueError, match="n_workers specified twice"):
FrameAnalysis(u.trajectory).run(
backend=backend_instance,
n_workers=1,
unsupported_backend=True
)

@pytest.mark.parametrize('run_class,backend,n_workers', [
(Parallelizable, 'not-existing-backend', 2),
(Parallelizable, 'not-existing-backend', None),
Expand Down

0 comments on commit abc9806

Please sign in to comment.