Skip to content

Commit

Permalink
Parameterise restart test over HMR and non-HMR example systems.
Browse files Browse the repository at this point in the history
  • Loading branch information
lohedges committed Nov 15, 2023
1 parent 623e39f commit 7cd5f7a
Showing 1 changed file with 5 additions and 8 deletions.
13 changes: 5 additions & 8 deletions tests/runner/test_restart.py
Original file line number Diff line number Diff line change
Expand Up @@ -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",
Expand Down Expand Up @@ -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()

0 comments on commit 7cd5f7a

Please sign in to comment.