diff --git a/mdpow/tests/test_fep_script.py b/mdpow/tests/test_fep_script.py index 2ebed629..a8e9ebdd 100644 --- a/mdpow/tests/test_fep_script.py +++ b/mdpow/tests/test_fep_script.py @@ -1,8 +1,9 @@ -from . import tempdir as td - import os +import pytest import pybol +from . import tempdir as td + import gromacs import mdpow @@ -43,14 +44,26 @@ def _run_fep(self, solvent, dirname): gromacs.cbook.edit_mdp(mdp, new_mdp=os.path.join(os.getcwd(), fep_mdp_name), cutoff_scheme="group") - self.S = fep_simulation(cfg, solvent, dirname=dirname) + self.savefilename = fep_simulation(cfg, solvent, dirname=dirname, exit_on_error=False) - def test_default_run(self): + def test_default_run(self, capsys): with gromacs.utilities.in_dir(self.tmpdir.name, create=False): try: self._run_fep('water', 'benzene/') except Exception as err: - raise AssertionError('FEP simulations failed with exception:\n{0}'.format(str(err))) + # check if log file contains + # 'There are 2 perturbed non-bonded pair interactions beyond the pair-list cutoff' + # This error can happen and still counts as passing. (It is stochastic and is due + # to a poorly designed test system together with GROMACS having become better at detecting + # internal problems.) + captured = capsys.readouterr() + for line in captured: + if "perturbed non-bonded pair interactions beyond the pair-list cutoff'" in line: + pytest.xfail("Stochastic test failure (perturbed non-bonded beyond cutoff). " + "Still works as expected, see #175.") + break + else: + raise AssertionError('FEP simulations failed with exception:\n{0}'.format(str(err))) assert os.path.exists(os.path.join(self.tmpdir.name, 'benzene', 'FEP', 'water', 'VDW', '0000', 'md.edr'))