Skip to content

Commit 6dc6ecd

Browse files
committed
Fix a test helper
It should have been using xp.real(x) instead of x.real. I'm not sure if float(x) or complex(x) would be better instead.
1 parent fb49802 commit 6dc6ecd

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

array_api_tests/pytest_helpers.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -464,8 +464,8 @@ def assert_array_elements(
464464
f"{sh.fmt_idx(out_repr, idx)}={at_out}, should be {at_expected} "
465465
f"{f_func}"
466466
)
467-
_assert_float_element(at_out.real, at_expected.real, msg)
468-
_assert_float_element(at_out.imag, at_expected.imag, msg)
467+
_assert_float_element(xp.real(at_out), xp.real(at_expected), msg)
468+
_assert_float_element(xp.imag(at_out), xp.imag(at_expected), msg)
469469
else:
470470
assert xp.all(
471471
out == expected

0 commit comments

Comments
 (0)