Skip to content

Commit

Permalink
Re-add platform specific skipif decorators that were removed.
Browse files Browse the repository at this point in the history
  • Loading branch information
lohedges committed Jul 3, 2024
1 parent 6b092d2 commit ce3c877
Show file tree
Hide file tree
Showing 3 changed files with 24 additions and 0 deletions.
3 changes: 3 additions & 0 deletions tests/Sandpit/Exscientia/FreeEnergy/test_restraint.py
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,8 @@
from BioSimSpace.Sandpit.Exscientia.Units.Length import angstrom
from BioSimSpace.Sandpit.Exscientia.Units.Temperature import kelvin

from tests.conftest import has_gromacs

# Store the tutorial URL.
url = BSS.tutorialUrl()

Expand Down Expand Up @@ -75,6 +77,7 @@ def boresch_restraint_component():
return system, restraint_dict


@pytest.mark.skipif(has_gromacs is False, reason="Requires GROMACS to be installed.")
@pytest.mark.parametrize(
("protocol", "posres"),
[
Expand Down
4 changes: 4 additions & 0 deletions tests/Sandpit/Exscientia/Process/test_amber.py
Original file line number Diff line number Diff line change
Expand Up @@ -378,6 +378,10 @@ def test_parse_fep_output(system, protocol):
assert len(records_sc1) != 0


@pytest.mark.skipif(
has_amber is False or has_pyarrow is False,
reason="Requires AMBER and pyarrow to be installed.",
)
class TestsaveMetric:
@staticmethod
@pytest.fixture()
Expand Down
17 changes: 17 additions & 0 deletions tests/Sandpit/Exscientia/Process/test_position_restraint.py
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,7 @@
from BioSimSpace.Sandpit.Exscientia.Units.Energy import kj_per_mol
from BioSimSpace.Sandpit.Exscientia.Units.Length import angstrom
from BioSimSpace.Sandpit.Exscientia._SireWrappers import Molecule
from tests.Sandpit.Exscientia.conftest import has_amber, has_gromacs, has_openff
from tests.conftest import root_fp


Expand Down Expand Up @@ -138,6 +139,10 @@ def protocol(request, restraint, free_energy, minimisation, equilibration, produ
return BSS.Protocol.Production(**production, **restraint)


@pytest.mark.skipif(
has_gromacs is False or has_openff is False,
reason="Requires GROMACS and openff to be installed",
)
def test_gromacs(protocol, system, ref_system, tmp_path):
proc = BSS.Process.Gromacs(
system,
Expand All @@ -162,6 +167,10 @@ def test_gromacs(protocol, system, ref_system, tmp_path):
assert len(diff)


@pytest.mark.skipif(
has_amber is False or has_openff is False,
reason="Requires AMBER and openff to be installed",
)
def test_amber(protocol, system, ref_system, tmp_path):
if not isinstance(protocol, BSS.Protocol._FreeEnergyMixin):
pytest.skip("AMBER position restraint only works for free energy protocol")
Expand All @@ -187,6 +196,10 @@ def test_amber(protocol, system, ref_system, tmp_path):
assert f"{proc._work_dir}/{proc.getArgs()['-ref']}" == proc._ref_file


@pytest.mark.skipif(
has_gromacs is False or has_openff is False,
reason="Requires GROMACS and openff to be installed",
)
@pytest.mark.parametrize(
"restraint",
["backbone", "heavy", "all", "none"],
Expand Down Expand Up @@ -232,6 +245,10 @@ def test_gromacs_alchemical_ion(
assert gro[2].split() == ["1ACE", "HH31", "1", "0.000", "0.000", "0.000"]


@pytest.mark.skipif(
has_amber is False or has_gromacs is False or has_openff is False,
reason="Requires AMBER, GROMACS and OpenFF to be installed",
)
@pytest.mark.parametrize(
("restraint", "protocol", "target"),
[
Expand Down

0 comments on commit ce3c877

Please sign in to comment.