Skip to content

Commit f8286d9

Browse files
committed
Move assert out of jitted function
1 parent 365ea12 commit f8286d9

File tree

1 file changed

+4
-6
lines changed

1 file changed

+4
-6
lines changed

tests/link/numba/test_sparse.py

Lines changed: 4 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -77,14 +77,12 @@ def test_fn(x):
7777
def test_sparse_copy():
7878
@numba.njit
7979
def test_fn(x):
80-
y = x.copy()
81-
return (
82-
y is not x and np.all(x.data == y.data) and np.all(x.indices == y.indices)
83-
)
80+
return x.copy()
8481

85-
x_val = sp.sparse.csr_matrix(np.eye(100))
82+
x = sp.sparse.csr_matrix(np.eye(100))
8683

87-
assert test_fn(x_val)
84+
y = test_fn(x)
85+
assert y is not x and np.all(x.data == y.data) and np.all(x.indices == y.indices)
8886

8987

9088
def test_sparse_objmode():

0 commit comments

Comments
 (0)