Skip to content
Merged
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
5 changes: 5 additions & 0 deletions array_api_tests/dtype_helpers.py
Original file line number Diff line number Diff line change
Expand Up @@ -164,6 +164,11 @@ def _make_dtype_tuple_from_names(names: List[str]) -> Tuple[DataType]:
}


def available_kinds():
return {
kind for kind, dtypes in kind_to_dtypes.items() if dtypes
}

def is_int_dtype(dtype):
return dtype in all_int_dtypes

Expand Down
4 changes: 3 additions & 1 deletion array_api_tests/test_inspection_functions.py
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
import pytest
from hypothesis import given, strategies as st
from array_api_tests.dtype_helpers import available_kinds

from . import xp

Expand All @@ -16,7 +17,8 @@ def test_array_namespace_info():

default_dtypes = out.default_dtypes()
assert isinstance(default_dtypes, dict)
assert {"real floating", "complex floating", "integral", "indexing"}.issubset(set(default_dtypes.keys()))
expected_subset = {"real floating", "complex floating", "integral"} & available_kinds() | {"indexing"}
assert expected_subset.issubset(set(default_dtypes.keys()))

devices = out.devices()
assert isinstance(devices, list)
Expand Down