Skip to content

Commit f244f40

Browse files
authored
Suppress RuntimeWarning in tests (#2580)
The PR suppresses new `RuntimeWarning` numpy raises in the tests.
1 parent c30a2a4 commit f244f40

File tree

4 files changed

+5
-1
lines changed

4 files changed

+5
-1
lines changed

dpnp/tests/test_strides.py

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -182,6 +182,7 @@ def test_erf(dtype):
182182
assert_dtype_allclose(result, expected)
183183

184184

185+
@pytest.mark.filterwarnings("ignore::RuntimeWarning")
185186
@pytest.mark.parametrize("dtype", get_float_complex_dtypes())
186187
@pytest.mark.parametrize("stride", [2, -1, -3])
187188
def test_reciprocal(dtype, stride):

dpnp/tests/test_umath.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -445,7 +445,7 @@ def test_large_values(self, dtype):
445445

446446

447447
class TestReciprocal:
448-
@pytest.mark.usefixtures("suppress_divide_numpy_warnings")
448+
@pytest.mark.filterwarnings("ignore::RuntimeWarning")
449449
@pytest.mark.parametrize("dtype", get_float_complex_dtypes())
450450
def test_reciprocal(self, dtype):
451451
a = generate_random_numpy_array(10, dtype)

dpnp/tests/third_party/cupy/math_tests/test_arithmetic.py

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -134,6 +134,7 @@ def test_raises_with_numpy_input(self):
134134
)
135135
class TestArithmeticUnary:
136136

137+
@pytest.mark.filterwarnings("ignore::RuntimeWarning")
137138
@testing.numpy_cupy_allclose(atol=1e-5, type_check=has_support_aspect64())
138139
def test_unary(self, xp):
139140
arg1 = self.arg1

dpnp/tests/third_party/cupy/math_tests/test_misc.py

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -250,6 +250,7 @@ def test_nan_to_num_for_old_numpy(self):
250250
def test_nan_to_num_negative_for_old_numpy(self):
251251
self.check_unary_negative("nan_to_num", no_bool=True)
252252

253+
@pytest.mark.filterwarnings("ignore::RuntimeWarning")
253254
def test_nan_to_num_inf(self):
254255
self.check_unary_inf("nan_to_num")
255256

@@ -260,6 +261,7 @@ def test_nan_to_num_nan(self):
260261
def test_nan_to_num_scalar_nan(self, xp):
261262
return xp.nan_to_num(xp.array(xp.nan))
262263

264+
@pytest.mark.filterwarnings("ignore::RuntimeWarning")
263265
def test_nan_to_num_inf_nan(self):
264266
self.check_unary_inf_nan("nan_to_num")
265267

0 commit comments

Comments
 (0)