diff --git a/tests/runner/test_restart.py b/tests/runner/test_restart.py index dda67c9..386a1e7 100644 --- a/tests/runner/test_restart.py +++ b/tests/runner/test_restart.py @@ -10,13 +10,14 @@ from somd2.io import * -def test_restart(): - """Validate that a simulation can be run from a checkpoint file, +@pytest.mark.parametrize("mols", ["ethane_methanol", "ethane_methanol_hmr"]) +def test_restart(mols, request): + """ + Validate that a simulation can be run from a checkpoint file, with all trajcetories preserved. """ with tempfile.TemporaryDirectory() as tmpdir: - # Load the demo stream file. - mols = sr.load(sr.expand(sr.tutorial_url, "merged_molecule.s3")) + mols = request.getfixturevalue(mols) config = { "runtime": "12fs", @@ -210,7 +211,3 @@ def test_restart(): # Load the new checkpoint file and make sure the restart fails with pytest.raises(ValueError): runner_badconfig = Runner(mols, Config(**config_new)) - - -if __name__ == "__main__": - test_restart()