diff --git a/dpnp/tests/test_mathematical.py b/dpnp/tests/test_mathematical.py index 756367c4bcb4..c19b3a8714ff 100644 --- a/dpnp/tests/test_mathematical.py +++ b/dpnp/tests/test_mathematical.py @@ -2111,14 +2111,15 @@ def test_zeros(self, dt): result = dpnp.spacing(ia) expected = numpy.spacing(a) + tol = numpy.finfo(expected.dtype).resolution if numpy.lib.NumpyVersion(numpy.__version__) < "2.0.0": - assert_equal(result, expected) + assert_allclose(result, expected, rtol=tol, atol=tol) else: # numpy.spacing(-0.0) == numpy.spacing(0.0), i.e. NumPy returns # positive value (looks as a bug in NumPy), because for any other # negative input the NumPy result will be also a negative value. expected[1] *= -1 - assert_equal(result, expected) + assert_allclose(result, expected, rtol=tol, atol=tol) @pytest.mark.parametrize("dt", get_float_dtypes(no_float16=False)) @pytest.mark.parametrize("val", [1, 1e-5, 1000]) diff --git a/dpnp/tests/test_product.py b/dpnp/tests/test_product.py index 95c643a6494c..eab4fe9f53ec 100644 --- a/dpnp/tests/test_product.py +++ b/dpnp/tests/test_product.py @@ -799,7 +799,7 @@ def test_axes(self, dtype, axes): result = dpnp.tensordot(ia, ib, axes=axes) expected = numpy.tensordot(a, b, axes=axes) - assert_dtype_allclose(result, expected) + assert_dtype_allclose(result, expected, factor=9) @pytest.mark.parametrize("dtype1", get_all_dtypes()) @pytest.mark.parametrize("dtype2", get_all_dtypes()) @@ -844,7 +844,7 @@ def test_linalg(self, axes): result = dpnp.linalg.tensordot(ia, ib, axes=axes) expected = numpy.linalg.tensordot(a, b, axes=axes) - assert_dtype_allclose(result, expected) + assert_dtype_allclose(result, expected, factor=9) def test_error(self): a = 5