Skip to content

Commit 21e8eab

Browse files
committed
suppress overflow warning
1 parent f3a5c25 commit 21e8eab

File tree

2 files changed

+8
-0
lines changed

2 files changed

+8
-0
lines changed

tests/conftest.py

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -137,6 +137,13 @@ def suppress_mean_empty_slice_numpy_warnings():
137137
yield
138138

139139

140+
@pytest.fixture
141+
def suppress_overflow_encountered_in_cast_numpy_warnings():
142+
with warnings.catch_warnings():
143+
warnings.filterwarnings("ignore", r"overflow encountered in cast")
144+
yield
145+
146+
140147
@pytest.fixture
141148
def suppress_divide_invalid_numpy_warnings(
142149
suppress_divide_numpy_warnings, suppress_invalid_numpy_warnings

tests/test_mathematical.py

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -753,6 +753,7 @@ def test_prod_nanprod_dtype(func, in_dtype, out_dtype):
753753
assert_dtype_allclose(dpnp_res, np_res)
754754

755755

756+
@pytest.mark.usefixtures("suppress_overflow_encountered_in_cast_numpy_warnings")
756757
@pytest.mark.parametrize("func", ["prod", "nanprod"])
757758
def test_prod_nanprod_out(func):
758759
ia = dpnp.arange(1, 7).reshape((2, 3))

0 commit comments

Comments
 (0)