Skip to content

Commit c38f7a4

Browse files
committed
Use functional real()/imag() APIs
`real` and `imag` are not properties of API arrays!
1 parent 7b71693 commit c38f7a4

File tree

1 file changed

+3
-3
lines changed

1 file changed

+3
-3
lines changed

array_api_tests/pytest_helpers.py

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -485,7 +485,7 @@ def assert_array_elements(
485485
>>> assert xp.all(out == x)
486486
487487
"""
488-
__tracebackhide__ = True
488+
# __tracebackhide__ = True
489489
dh.result_type(out.dtype, expected.dtype) # sanity check
490490
assert_shape(func_name, out_shape=out.shape, expected=expected.shape, kw=kw) # sanity check
491491
f_func = f"[{func_name}({fmt_kw(kw)})]"
@@ -495,8 +495,8 @@ def assert_array_elements(
495495
if _real_float_strict_equals(out, expected):
496496
return
497497
elif out.dtype in dh.complex_dtypes:
498-
real_match = _real_float_strict_equals(out.real, expected.real)
499-
imag_match = _real_float_strict_equals(out.imag, expected.imag)
498+
real_match = _real_float_strict_equals(xp.real(out), xp.real(expected))
499+
imag_match = _real_float_strict_equals(xp.imag(out), xp.imag(expected))
500500
if real_match and imag_match:
501501
return
502502
else:

0 commit comments

Comments
 (0)