Skip to content

Commit ff5bbd3

Browse files
Skip unused kinds in default check
1 parent a882502 commit ff5bbd3

File tree

2 files changed

+7
-1
lines changed

2 files changed

+7
-1
lines changed

array_api_tests/dtype_helpers.py

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -164,6 +164,11 @@ def _make_dtype_tuple_from_names(names: List[str]) -> Tuple[DataType]:
164164
}
165165

166166

167+
def available_kinds():
168+
return {
169+
kind for kind, dtypes in kind_to_dtypes.items() if dtypes
170+
}
171+
167172
def is_int_dtype(dtype):
168173
return dtype in all_int_dtypes
169174

array_api_tests/test_inspection_functions.py

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,8 @@ def test_array_namespace_info():
1616

1717
default_dtypes = out.default_dtypes()
1818
assert isinstance(default_dtypes, dict)
19-
assert {"real floating", "complex floating", "integral", "indexing"}.issubset(set(default_dtypes.keys()))
19+
expected_subset = {"real floating", "complex floating", "integral"} & available_kinds() | {"indexing"}
20+
assert expected_subset.issubset(set(default_dtypes.keys()))
2021

2122
devices = out.devices()
2223
assert isinstance(devices, list)

0 commit comments

Comments
 (0)