Skip to content

Commit

Permalink
Do not fail test_sqrt_complex_fp_special_values on failure, but skip …
Browse files Browse the repository at this point in the history
…the test with message
  • Loading branch information
oleksandr-pavlyk committed Dec 5, 2023
1 parent a545c33 commit 9180ecf
Showing 1 changed file with 9 additions and 5 deletions.
14 changes: 9 additions & 5 deletions dpctl/tests/elementwise/test_sqrt.py
Original file line number Diff line number Diff line change
Expand Up @@ -180,9 +180,13 @@ def test_sqrt_complex_fp_special_values(dtype):

if not dpt.allclose(r, expected, atol=tol, rtol=tol, equal_nan=True):
for i in range(r.shape[0]):
assert dpt.allclose(
failure_data = []
if not dpt.allclose(
r[i], expected[i], atol=tol, rtol=tol, equal_nan=True
), (
f"Test failed for input {z[i]}, i.e. {c_[i]} for index {i}"
f", results were {r[i]} vs. {expected[i]}"
)
):
msg = (
f"Test failed for input {z[i]}, i.e. {c_[i]} for index {i}"
)
msg += f", results were {r[i]} vs. {expected[i]}"
failure_data.extend(msg)
pytest.skip(reason=msg)

0 comments on commit 9180ecf

Please sign in to comment.