Skip to content

Commit 922e13a

Browse files
committed
TST: improve metric_prefix coverage
1 parent 55649de commit 922e13a

File tree

1 file changed

+5
-0
lines changed

1 file changed

+5
-0
lines changed

tests/test_protocol.py

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -209,6 +209,7 @@ def test_parse_success(self, unit, value):
209209
"abc",
210210
"petermeters",
211211
"nanopeters",
212+
"Xm",
212213
],
213214
)
214215
def test_parse_fail(self, test_value):
@@ -261,6 +262,10 @@ def test_from_float(self, test_value, answer_mantissa, answer_exponent):
261262
assert pytest.approx(val) == answer_mantissa
262263
assert mprefix is answer_exponent
263264

265+
def test_from_float_raises(self):
266+
with pytest.raises(ValueError, match="Value is out of range"):
267+
MetricPrefix.from_float(1e123)
268+
264269
@pytest.mark.parametrize(
265270
("test_value", "test_exponent", "answer_mantissa", "answer_exponent"),
266271
[

0 commit comments

Comments
 (0)