Skip to content

Commit 63a0f33

Browse files
committed
bring coverage back to 100%
1 parent ff4bc78 commit 63a0f33

3 files changed

Lines changed: 10 additions & 1 deletion

File tree

‎paths_cli/compat/openmm.py‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@
55
except ImportError:
66
try:
77
from simtk import openmm as mm
8-
from simtk import unit
8+
from simtk import unit # -no-cov-
99
except ImportError:
1010
HAS_OPENMM = False
1111
mm = None

‎paths_cli/compiling/tools.py‎

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,5 @@
11
import numpy as np
2+
from .errors import InputError
23

34
def custom_eval(obj, named_objs=None):
45
"""Parse user input to allow simple math.

‎paths_cli/tests/compiling/test_tools.py‎

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,7 @@
22
import numpy.testing as npt
33
import numpy as np
44
import math
5+
from paths_cli.compiling.errors import InputError
56

67
from paths_cli.compiling.tools import *
78

@@ -13,6 +14,13 @@
1314
def test_custom_eval(expr, expected):
1415
npt.assert_allclose(custom_eval(expr), expected)
1516

17+
def test_custom_eval_int():
18+
assert custom_eval_int('5') == 5
19+
20+
def test_custom_eval_int_strict_pos_error():
21+
with pytest.raises(InputError):
22+
custom_eval_int_strict_pos(-1)
23+
1624
def test_mdtraj_parse_atomlist_bad_input():
1725
with pytest.raises(TypeError, match="not integers"):
1826
mdtraj_parse_atomlist("['a', 'b']", n_atoms=2)

0 commit comments

Comments
 (0)