Skip to content

Commit aca643a

Browse files
committed
Add : adding test with_warning_inf
1 parent 8401c07 commit aca643a

File tree

1 file changed

+11
-0
lines changed

1 file changed

+11
-0
lines changed

mapie/tests/test_utils.py

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -421,6 +421,17 @@ def test_inf_values() -> None:
421421
check_array_inf(np.array([1, 2, -np.inf, 4]))
422422

423423

424+
def test_inf_values_with_warning_inf() -> None:
425+
"""
426+
Test if array has infinite values like +inf or -inf
427+
"""
428+
with pytest.warns(
429+
UserWarning,
430+
match=r"Array contains infinite values."
431+
):
432+
check_array_inf(np.array([1, 2, -np.inf, 4]), warning_inf=True)
433+
434+
424435
def test_length() -> None:
425436
"""
426437
Test if the arrays have the same size (length)

0 commit comments

Comments
 (0)