Skip to content

Commit 9deb430

Browse files
committed
Skip test for AmberTools >= 24.0.
1 parent 75e9549 commit 9deb430

File tree

4 files changed

+62
-7
lines changed

4 files changed

+62
-7
lines changed

tests/Parameters/test_parameters.py

Lines changed: 9 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,13 @@
33

44
import BioSimSpace as BSS
55

6-
from tests.conftest import url, has_openff, has_tleap, has_antechamber
6+
from tests.conftest import (
7+
ambertools_version,
8+
url,
9+
has_openff,
10+
has_tleap,
11+
has_antechamber,
12+
)
713

814

915
@pytest.fixture(scope="session")
@@ -170,13 +176,13 @@ def test_smiles_stereo():
170176

171177

172178
@pytest.mark.skipif(
173-
has_antechamber is False or has_tleap is False,
179+
has_antechamber is False or has_tleap is False or ambertools_version >= 24.0,
174180
reason="Requires AmberTools/antechamber and tLEaP to be installed.",
175181
)
176182
def test_acdoctor():
177183
"""
178184
Test that parameterising negatively charged molecules works when acdoctor
179-
is disabled.
185+
is disabled. This problem does not occur with AmberTools 24.0 or later.
180186
"""
181187

182188
# Load the molecule.

tests/Sandpit/Exscientia/Parameters/test_parameters.py

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,7 @@
44
import BioSimSpace.Sandpit.Exscientia as BSS
55

66
from tests.Sandpit.Exscientia.conftest import (
7+
ambertools_version,
78
url,
89
has_openff,
910
has_tleap,
@@ -175,13 +176,13 @@ def test_smiles_stereo():
175176

176177

177178
@pytest.mark.skipif(
178-
has_antechamber is False or has_tleap is False,
179+
has_antechamber is False or has_tleap is False or ambertools_version >= 24.0,
179180
reason="Requires AmberTools/antechamber and tLEaP to be installed.",
180181
)
181182
def test_acdoctor():
182183
"""
183184
Test that parameterising negatively charged molecules works when acdoctor
184-
is disabled.
185+
is disabled. This problem does not occur with AmberTools 24.0 or later.
185186
"""
186187

187188
# Load the molecule.

tests/Sandpit/Exscientia/conftest.py

Lines changed: 27 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,11 @@
1212
from BioSimSpace.Sandpit.Exscientia.Units.Time import femtosecond
1313
from BioSimSpace.Sandpit.Exscientia._SireWrappers import Molecule
1414

15-
from BioSimSpace.Sandpit.Exscientia._Utils import _try_import, _have_imported
15+
from BioSimSpace.Sandpit.Exscientia._Utils import (
16+
command_split,
17+
_try_import,
18+
_have_imported,
19+
)
1620

1721
# Store the tutorial URL.
1822
url = BSS.tutorialUrl()
@@ -27,8 +31,30 @@
2731
has_amber = True
2832
else:
2933
has_amber = False
34+
35+
import shlex
36+
import subprocess
37+
38+
# Check the AmberTools version.
39+
40+
proc = subprocess.run(
41+
command_split(f"{exe} -V"),
42+
shell=False,
43+
text=True,
44+
stdout=subprocess.PIPE,
45+
stderr=subprocess.PIPE,
46+
)
47+
48+
lines = proc.stdout.split("\n")
49+
50+
try:
51+
string = lines[0].replace("sander: Version ", "")
52+
ambertools_version = float(string)
53+
except:
54+
ambertools_version = None
3055
else:
3156
has_amber = False
57+
ambertools_version = None
3258

3359
# Make sure NAMD is installed.
3460
try:

tests/conftest.py

Lines changed: 23 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@
77

88
import BioSimSpace as BSS
99

10-
from BioSimSpace._Utils import _try_import, _have_imported
10+
from BioSimSpace._Utils import command_split, _try_import, _have_imported
1111

1212
# Store the tutorial URL.
1313
url = BSS.tutorialUrl()
@@ -22,8 +22,30 @@
2222
has_amber = True
2323
else:
2424
has_amber = False
25+
26+
import shlex
27+
import subprocess
28+
29+
# Check the AmberTools version.
30+
31+
proc = subprocess.run(
32+
command_split(f"{exe} -V"),
33+
shell=False,
34+
text=True,
35+
stdout=subprocess.PIPE,
36+
stderr=subprocess.PIPE,
37+
)
38+
39+
lines = proc.stdout.split("\n")
40+
41+
try:
42+
string = lines[0].replace("sander: Version ", "")
43+
ambertools_version = float(string)
44+
except:
45+
ambertools_version = None
2546
else:
2647
has_amber = False
48+
ambertools_version = None
2749

2850
# Make sure NAMD is installed.
2951
try:

0 commit comments

Comments
 (0)