Skip to content

Commit 7e48141

Browse files
authored
Merge pull request #156 from asmeurer/can_cast-fix
Don't require can_cast to return False for cross-kind casting
2 parents abe10f9 + 3539267 commit 7e48141

File tree

1 file changed

+5
-1
lines changed

1 file changed

+5
-1
lines changed

array_api_tests/test_data_type_functions.py

+5-1
Original file line numberDiff line numberDiff line change
@@ -124,7 +124,11 @@ def test_can_cast(_from, to, data):
124124
expected = from_min >= to_min and from_max <= to_max
125125
else:
126126
expected = False
127-
assert out == expected, f"{out=}, but should be {expected} {f_func}"
127+
if expected:
128+
# cross-kind casting is not explicitly disallowed. We can only test
129+
# the cases where it should return True. TODO: if expected=False,
130+
# check that the array library actually allows such casts.
131+
assert out == expected, f"{out=}, but should be {expected} {f_func}"
128132

129133

130134
def make_dtype_id(dtype: DataType) -> str:

0 commit comments

Comments
 (0)