Skip to content

Commit 5551ae6

Browse files
committed
Adding test for types
Signed-off-by: Pradyot Ranjan <[email protected]>
1 parent d7850ac commit 5551ae6

File tree

1 file changed

+4
-1
lines changed

1 file changed

+4
-1
lines changed

sparse/numba_backend/tests/test_coo.py

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1934,8 +1934,11 @@ def test_repeat(ndim, repeats):
19341934
rng = np.random.default_rng()
19351935
shape = tuple(rng.integers(1, 4) for _ in range(ndim))
19361936
a = rng.integers(1, 10, size=shape)
1937+
with pytest.raises(TypeError, match="`a` must be a SparseArray"):
1938+
sparse.repeat(a, repeats=2)
19371939
sparse_a = COO.from_numpy(a)
1938-
1940+
with pytest.raises(Exception, match="`repeats` must be an integer"):
1941+
sparse.repeat(sparse_a, repeats=[2, 2, 2])
19391942
for axis in range(ndim):
19401943
expected = np.repeat(a, repeats=repeats, axis=axis)
19411944
result_sparse = sparse.repeat(sparse_a, repeats=repeats, axis=axis)

0 commit comments

Comments
 (0)