Skip to content

Commit

Permalink
FIX: Fix skipping tests requiring GROMACS
Browse files Browse the repository at this point in the history
  • Loading branch information
mattwthompson committed May 7, 2024
1 parent 33e21dd commit 1dc1529
Show file tree
Hide file tree
Showing 2 changed files with 15 additions and 11 deletions.
Original file line number Diff line number Diff line change
@@ -1,13 +1,15 @@
import pytest
from openff.toolkit import Quantity

from openff.interchange._tests import needs_gmx
from openff.interchange.drivers.gromacs import get_gromacs_energies
from openff.interchange.interop.gromacs._import._import import from_files
from openff.interchange.interop.gromacs._interchange import to_interchange


class TestToInterchange:

@needs_gmx
def test_torsion_multiplicities_stored_in_keys(
self,
ethanol,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,12 @@
import openmm.unit


class TestToGro:
@needs_gmx
class _NeedsGROMACS:
pass


class TestToGro(_NeedsGROMACS):
def test_residue_names(self, sage):
"""Reproduce issue #642."""
# This could maybe just test the behavior of _convert?
Expand Down Expand Up @@ -69,8 +74,7 @@ def test_tip4p_dimer(self, tip4p, water_dimer):

@skip_if_missing("mdtraj")
@skip_if_missing("openmm")
@needs_gmx
class TestGROMACSGROFile:
class TestGROMACSGROFile(_NeedsGROMACS):
try:
_INTERMOL_PATH = resources.files(
"intermol.tests.gromacs.unit_tests",
Expand Down Expand Up @@ -190,8 +194,7 @@ def test_atom_names_pdb(self):
assert openmm_atom_names == pdb_atom_names


@needs_gmx
class TestGROMACS:
class TestGROMACS(_NeedsGROMACS):
@pytest.mark.slow
@pytest.mark.parametrize(
"smiles",
Expand Down Expand Up @@ -490,7 +493,7 @@ def test_roundtrip_with_combine(
)


class TestGROMACSMetadata:
class TestGROMACSMetadata(_NeedsGROMACS):
@skip_if_missing("openmm")
@skip_if_missing("mdtraj")
@pytest.mark.slow
Expand Down Expand Up @@ -525,7 +528,7 @@ def test_atom_names_pdb(self):
assert openmm_atom_names == pdb_atom_names


class TestSettles:
class TestSettles(_NeedsGROMACS):
def test_settles_units(self, monkeypatch, water):
"""Reproduce issue #720."""
monkeypatch.setenv("INTERCHANGE_EXPERIMENTAL", "1")
Expand All @@ -552,7 +555,7 @@ def test_settles_units(self, monkeypatch, water):

@pytest.mark.slow
@requires_package("openmm")
class TestCommonBoxes:
class TestCommonBoxes(_NeedsGROMACS):
@pytest.mark.parametrize(
"pdb_file",
[
Expand Down Expand Up @@ -588,7 +591,7 @@ def test_common_boxes(self, pdb_file):
)


class TestMergeAtomTypes:
class TestMergeAtomTypes(_NeedsGROMACS):
@pytest.mark.slow
@pytest.mark.parametrize(
"smiles",
Expand Down Expand Up @@ -703,8 +706,7 @@ def test_merge_atom_types_of_similar_molecules(
]


@needs_gmx
class TestGROMACSVirtualSites:
class TestGROMACSVirtualSites(_NeedsGROMACS):
@pytest.fixture
def sigma_hole_type(self, sage):
"""A handler with a bond charge virtual site on a C-Cl bond."""
Expand Down

0 comments on commit 1dc1529

Please sign in to comment.