Skip to content

Commit 29e77f4

Browse files
committed
updated test to a single function
1 parent f216c06 commit 29e77f4

1 file changed

Lines changed: 3 additions & 15 deletions

File tree

testsuite/MDAnalysisTests/transformations/test_nojump.py

Lines changed: 3 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -381,26 +381,14 @@ def test_notinvertible(nojump_universe):
381381
transformed_coordinates = u.trajectory.timeseries()[0]
382382

383383

384-
def test_nojump_fails_when_not_at_frame_0():
384+
@pytest.mark.parametrize("frame_index", [-1, 5])
385+
def test_nojump_fails_when_not_at_frame_0(frame_index):
385386
"""
386387
Test that NoJump raises a clear error when applied to a trajectory
387388
that is not at frame 0.
388389
"""
389390
u = mda.Universe(data.PSF_TRICLINIC, data.DCD_TRICLINIC)
390-
u.trajectory[-1]
391-
392-
with pytest.raises(
393-
ValueError, match="must be applied starting from frame 0"
394-
):
395-
u.trajectory.add_transformations(NoJump())
396-
397-
398-
def test_nojump_fails_midtrajectory():
399-
"""
400-
Test that NoJump raises a clear error when applied in the middle of a trajectory.
401-
"""
402-
u = mda.Universe(data.PSF_TRICLINIC, data.DCD_TRICLINIC)
403-
u.trajectory[5]
391+
u.trajectory[frame_index]
404392

405393
with pytest.raises(
406394
ValueError, match="must be applied starting from frame 0"

0 commit comments

Comments
 (0)