Skip to content

Commit c716de1

Browse files
authored
Merge pull request #378 from ev-br/test_max_dims
BUG: allow max_dimensions to be None
2 parents ccdf915 + d70079e commit c716de1

File tree

1 file changed

+3
-2
lines changed

1 file changed

+3
-2
lines changed

array_api_tests/test_inspection_functions.py

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -16,13 +16,14 @@ def test_capabilities(self):
1616

1717
expected_attr = {"boolean indexing": bool, "data-dependent shapes": bool}
1818
if xp.__array_api_version__ >= "2024.12":
19-
expected_attr.update(**{"max dimensions": int})
19+
expected_attr.update(**{"max dimensions": type(None) | int})
2020

2121
for attr, typ in expected_attr.items():
2222
assert attr in capabilities, f'capabilites is missing "{attr}".'
2323
assert isinstance(capabilities[attr], typ)
2424

25-
assert capabilities.get("max dimensions", 100500) > 0
25+
max_dims = capabilities.get("max dimensions", 100500)
26+
assert (max_dims is None) or (max_dims > 0)
2627

2728
def test_devices(self):
2829
out = xp.__array_namespace_info__()

0 commit comments

Comments
 (0)