8000 Merge pull request #337 from adityagoel4512/skip-unused-kinds-in-default · adityagoel4512/array-api-tests@dad7731 · GitHub
[go: up one dir, main page]

Skip to content

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Appearance settings

Commit dad7731

Browse files
authored
Merge pull request data-apis#337 from adityagoel4512/skip-unused-kinds-in-default
Do not require default dtype if no dtypes in kind supported
2 parents d982a62 + 80c2978 commit dad7731

File tree

2 files changed

+8
-1
lines changed

2 files changed

+8
-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: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,6 @@
11
import pytest
22
from hypothesis import given, strategies as st
3+
from array_api_tests.dtype_helpers import available_kinds
34

45
from . import xp
56

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

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

2123
devices = out.devices()
2224
assert isinstance(devices, list)

0 commit comments

Comments
 (0)
0