Skip to content

Commit ec915ff

Browse files
authored
TST: test coverage for vendored functions (#93)
1 parent 5f4fa99 commit ec915ff

File tree

2 files changed

+5
-3
lines changed

2 files changed

+5
-3
lines changed

src/array_api_extra/_lib/_utils/_compat.pyi

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -23,8 +23,8 @@ def is_cupy_namespace(xp: ModuleType, /) -> bool: ...
2323
def is_dask_namespace(xp: ModuleType, /) -> bool: ...
2424
def is_jax_namespace(xp: ModuleType, /) -> bool: ...
2525
def is_numpy_namespace(xp: ModuleType, /) -> bool: ...
26+
def is_pydata_sparse_namespace(xp: ModuleType, /) -> bool: ...
2627
def is_torch_namespace(xp: ModuleType, /) -> bool: ...
2728
def is_jax_array(x: object, /) -> bool: ...
28-
def is_pydata_sparse_namespace(xp: ModuleType, /) -> bool: ...
2929
def is_writeable_array(x: object, /) -> bool: ...
3030
def size(x: Array, /) -> int | None: ...

vendor_tests/test_vendor.py

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,7 @@ def test_vendor_compat():
77
array_namespace,
88
device,
99
is_cupy_namespace,
10+
is_dask_namespace,
1011
is_jax_array,
1112
is_jax_namespace,
1213
is_pydata_sparse_namespace,
@@ -18,12 +19,13 @@ def test_vendor_compat():
1819
x = xp.asarray([1, 2, 3])
1920
assert array_namespace(x) is xp
2021
device(x)
21-
assert not is_jax_array(x)
22-
assert is_writeable_array(x)
2322
assert not is_cupy_namespace(xp)
23+
assert not is_dask_namespace(xp)
24+
assert not is_jax_array(x)
2425
assert not is_jax_namespace(xp)
2526
assert not is_pydata_sparse_namespace(xp)
2627
assert not is_torch_namespace(xp)
28+
assert is_writeable_array(x)
2729
assert size(x) == 3
2830

2931

0 commit comments

Comments
 (0)