From 2feb2a1b78f69da6960ef03c523f4de5908b1196 Mon Sep 17 00:00:00 2001 From: Vahid Tavanashad Date: Thu, 31 Oct 2024 11:35:10 -0500 Subject: [PATCH] update a test for dpnp.pad with mode empty to avoid direct comparison --- tests/test_arraypad.py | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/tests/test_arraypad.py b/tests/test_arraypad.py index 45c7aee47456..6f2ad4abc650 100644 --- a/tests/test_arraypad.py +++ b/tests/test_arraypad.py @@ -432,7 +432,10 @@ def test_pad_empty_dim_valid(self, mode): a_dp = dpnp.array(a_np) expected = numpy.pad(a_np, [(0,), (2,), (1,)], mode) result = dpnp.pad(a_dp, [(0,), (2,), (1,)], mode) - assert_dtype_allclose(result, expected) + assert result.shape == expected.shape + if mode == "constant": + # In "empty" mode, arrays are uninitialized and comparing may fail + assert_dtype_allclose(result, expected) @pytest.mark.parametrize( "mode",