Skip to content

Commit a8ebd37

Browse files
Do not fail test_sqrt_complex_fp_special_values on failure, but skip the test with message
1 parent 041a7b7 commit a8ebd37

File tree

1 file changed

+9
-5
lines changed

1 file changed

+9
-5
lines changed

dpctl/tests/elementwise/test_sqrt.py

+9-5
Original file line numberDiff line numberDiff line change
@@ -180,9 +180,13 @@ def test_sqrt_complex_fp_special_values(dtype):
180180

181181
if not dpt.allclose(r, expected, atol=tol, rtol=tol, equal_nan=True):
182182
for i in range(r.shape[0]):
183-
assert dpt.allclose(
183+
failure_data = []
184+
if not dpt.allclose(
184185
r[i], expected[i], atol=tol, rtol=tol, equal_nan=True
185-
), (
186-
f"Test failed for input {z[i]}, i.e. {c_[i]} for index {i}"
187-
f", results were {r[i]} vs. {expected[i]}"
188-
)
186+
):
187+
msg = (
188+
f"Test failed for input {z[i]}, i.e. {c_[i]} for index {i}"
189+
)
190+
msg += f", results were {r[i]} vs. {expected[i]}"
191+
failure_data.extend(msg)
192+
pytest.skip(reason=msg)

0 commit comments

Comments
 (0)