Skip to content

Commit 88bbc9b

Browse files
Merge 41ec5a4 into 8d7ed21
2 parents 8d7ed21 + 41ec5a4 commit 88bbc9b

File tree

1 file changed

+3
-2
lines changed

1 file changed

+3
-2
lines changed

dpnp/tests/test_mathematical.py

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2111,14 +2111,15 @@ def test_zeros(self, dt):
21112111

21122112
result = dpnp.spacing(ia)
21132113
expected = numpy.spacing(a)
2114+
tol = numpy.finfo(expected.dtype).resolution
21142115
if numpy.lib.NumpyVersion(numpy.__version__) < "2.0.0":
2115-
assert_equal(result, expected)
2116+
assert_allclose(result, expected, rtol=tol, atol=tol)
21162117
else:
21172118
# numpy.spacing(-0.0) == numpy.spacing(0.0), i.e. NumPy returns
21182119
# positive value (looks as a bug in NumPy), because for any other
21192120
# negative input the NumPy result will be also a negative value.
21202121
expected[1] *= -1
2121-
assert_equal(result, expected)
2122+
assert_allclose(result, expected, rtol=tol, atol=tol)
21222123

21232124
@pytest.mark.parametrize("dt", get_float_dtypes(no_float16=False))
21242125
@pytest.mark.parametrize("val", [1, 1e-5, 1000])

0 commit comments

Comments
 (0)