Skip to content

Commit 2bb02e2

Browse files
committed
Add test for uncovered raise
1 parent 001faf1 commit 2bb02e2

1 file changed

Lines changed: 8 additions & 0 deletions

File tree

‎openpathsampling/tests/test_volume.py‎

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -224,6 +224,14 @@ def test_get_cv_float(self, inp):
224224
expected = inp in ['float', 'array1']
225225
assert isinstance(val, float) is expected
226226

227+
@pytest.mark.filterwarnings("ignore:The CV 'cv' returns an iterable")
228+
def test_get_cv_float_array_raises(self):
229+
snap = make_1d_traj([0.0])[0]
230+
volume = self._vol_for_cv_type('array')
231+
with pytest.raises(TypeError,
232+
match="only 0-dimensional arrays can be converted"):
233+
_ = volume._get_cv_float(snap)
234+
227235

228236
class TestCVRangeVolumePeriodic(object):
229237
def setup_method(self):

0 commit comments

Comments
 (0)