From 905f197146d2223b2e4ffac8a581124d31b190c3 Mon Sep 17 00:00:00 2001 From: Valerij Talagayev <82884038+talagayev@users.noreply.github.com> Date: Thu, 28 Nov 2024 23:30:22 +0100 Subject: [PATCH] Addition of `pytest` case for not `None` values for `frames` and `start`/`stop`/`step` (#4769) --- testsuite/MDAnalysisTests/analysis/test_base.py | 13 +++++++++++++ 1 file changed, 13 insertions(+) diff --git a/testsuite/MDAnalysisTests/analysis/test_base.py b/testsuite/MDAnalysisTests/analysis/test_base.py index e2fe428376..377d70602b 100644 --- a/testsuite/MDAnalysisTests/analysis/test_base.py +++ b/testsuite/MDAnalysisTests/analysis/test_base.py @@ -122,6 +122,19 @@ def test_incompatible_n_workers(u): FrameAnalysis(u).run(backend=backend, n_workers=3) +def test_frame_values_incompatability(u): + start, stop, step = 0, 4, 1 + frames = [1, 2, 3, 4] + + with pytest.raises(ValueError, + match="start/stop/step cannot be combined with frames"): + FrameAnalysis(u.trajectory).run( + frames=frames, + start=start, + stop=stop, + step=step + ) + def test_n_workers_conflict_raises_value_error(u): backend_instance = ManyWorkersBackend(n_workers=4)