Skip to content

Commit c0a7bf2

Browse files
committed
Keep version check and use skip_dtypes instead
1 parent 0ab903a commit c0a7bf2

File tree

1 file changed

+3
-4
lines changed

1 file changed

+3
-4
lines changed

array_api_tests/dtype_helpers.py

Lines changed: 3 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -322,16 +322,15 @@ def accumulation_result_dtype(x_dtype, dtype_kwarg):
322322
default_float = xp.asarray(float()).dtype
323323
if default_float not in real_float_dtypes:
324324
warn(f"inferred default float is {default_float!r}, which is not a float")
325-
326-
if not (hasattr(xp, "complex32") or hasattr(xp, "complex64")):
327-
default_complex = None
328-
else:
325+
if api_version > "2021.12" and ({'complex64', 'complex128'} - set(skip_dtypes)):
329326
default_complex = xp.asarray(complex()).dtype
330327
if default_complex not in complex_dtypes:
331328
warn(
332329
f"inferred default complex is {default_complex!r}, "
333330
"which is not a complex"
334331
)
332+
else:
333+
default_complex = None
335334

336335
if dtype_nbits[default_int] == 32:
337336
default_uint = _name_to_dtype.get("uint32")

0 commit comments

Comments
 (0)