Skip to content

Commit ff4788f

Browse files
committed
address comments
1 parent dcea437 commit ff4788f

File tree

1 file changed

+8
-12
lines changed

1 file changed

+8
-12
lines changed

tests/test_mathematical.py

Lines changed: 8 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -1071,7 +1071,7 @@ def test_invalid_out(self, out):
10711071

10721072

10731073
class TestDivide:
1074-
@pytest.mark.parametrize("dtype", get_float_dtypes() + get_complex_dtypes())
1074+
@pytest.mark.parametrize("dtype", get_float_complex_dtypes())
10751075
def test_divide(self, dtype):
10761076
array1_data = numpy.arange(10)
10771077
array2_data = numpy.arange(5, 15)
@@ -1088,12 +1088,11 @@ def test_divide(self, dtype):
10881088
np_array2 = numpy.array(array2_data, dtype=dtype)
10891089
expected = numpy.divide(np_array1, np_array2, out=out)
10901090

1091-
tol = 1e-07
1092-
assert_allclose(expected, result, rtol=tol, atol=tol)
1093-
assert_allclose(out, dp_out, rtol=tol, atol=tol)
1091+
assert_dtype_allclose(result, expected)
1092+
assert_dtype_allclose(dp_out, out)
10941093

10951094
@pytest.mark.usefixtures("suppress_divide_invalid_numpy_warnings")
1096-
@pytest.mark.parametrize("dtype", get_float_dtypes() + get_complex_dtypes())
1095+
@pytest.mark.parametrize("dtype", get_float_complex_dtypes())
10971096
def test_out_dtypes(self, dtype):
10981097
size = 10
10991098

@@ -1115,12 +1114,10 @@ def test_out_dtypes(self, dtype):
11151114
dp_out = dpnp.empty(size, dtype=dtype)
11161115

11171116
result = dpnp.divide(dp_array1, dp_array2, out=dp_out)
1118-
1119-
tol = 1e-07
1120-
assert_allclose(expected, result, rtol=tol, atol=tol)
1117+
assert_dtype_allclose(result, expected)
11211118

11221119
@pytest.mark.usefixtures("suppress_divide_invalid_numpy_warnings")
1123-
@pytest.mark.parametrize("dtype", get_float_dtypes() + get_complex_dtypes())
1120+
@pytest.mark.parametrize("dtype", get_float_complex_dtypes())
11241121
def test_out_overlap(self, dtype):
11251122
size = 15
11261123
# DPNP
@@ -1131,10 +1128,9 @@ def test_out_overlap(self, dtype):
11311128
np_a = numpy.arange(2 * size, dtype=dtype)
11321129
numpy.divide(np_a[size::], np_a[::2], out=np_a[:size:])
11331130

1134-
tol = 1e-07
1135-
assert_allclose(np_a, dp_a, rtol=tol, atol=tol)
1131+
assert_dtype_allclose(dp_a, np_a)
11361132

1137-
@pytest.mark.parametrize("dtype", get_float_dtypes() + get_complex_dtypes())
1133+
@pytest.mark.parametrize("dtype", get_float_complex_dtypes())
11381134
def test_inplace_strided_out(self, dtype):
11391135
size = 21
11401136

0 commit comments

Comments
 (0)