Skip to content
Draft
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 3 additions & 0 deletions array_api_tests/test_creation_functions.py
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,7 @@
from . import shape_helpers as sh
from . import xps
from .typing import DataType, Scalar
from . import api_version


class frange(NamedTuple):
Expand Down Expand Up @@ -560,6 +561,8 @@ def test_meshgrid(dtype, data):
repro_snippet = ph.format_snippet(f"xp.meshgrid(*arrays) with {arrays = }")
try:
out = xp.meshgrid(*arrays)

assert type(out) == list if api_version < "2025.12" else tuple
for i, x in enumerate(out):
ph.assert_dtype("meshgrid", in_dtype=dtype, out_dtype=x.dtype, repr_name=f"out[{i}].dtype")
except Exception as exc:
Expand Down
4 changes: 3 additions & 1 deletion array_api_tests/test_data_type_functions.py
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@
from . import shape_helpers as sh
from . import xps
from .typing import DataType

from . import api_version

# TODO: test with complex dtypes
def non_complex_dtypes():
Expand Down Expand Up @@ -107,6 +107,8 @@ def test_broadcast_arrays(shapes, data):
try:
out = xp.broadcast_arrays(*arrays)

assert type(out) == list if api_version < "2025.12" else tuple

expected_shape = sh.broadcast_shapes(*shapes)
for i, x in enumerate(arrays):
ph.assert_dtype(
Expand Down
3 changes: 2 additions & 1 deletion array_api_tests/test_inspection_functions.py
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@
from array_api_tests.dtype_helpers import available_kinds, dtype_names

from . import xp
from . import api_version

pytestmark = pytest.mark.min_version("2023.12")

Expand Down Expand Up @@ -31,7 +32,7 @@ def test_devices(self):
assert hasattr(out, "devices")
assert hasattr(out, "default_device")

assert isinstance(out.devices(), list)
assert isinstance(out.devices(), list if api_version < "2025.12" else tuple)
if out.default_device() is not None:
# Per https://github.com/data-apis/array-api/issues/923
# default_device() can return None. Otherwise, it must be a valid device.
Expand Down