Skip to content

Commit 220e7f1

Browse files
committed
fix for older scipy tests
1 parent 66abe0e commit 220e7f1

File tree

1 file changed

+3
-3
lines changed

1 file changed

+3
-3
lines changed

sklearn/utils/tests/test_sparse.py

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -80,16 +80,16 @@ def test_estimator_property_sparse(sparse_interface, result_type):
8080

8181

8282
INDEX_CONSTRUCTORS = [
83-
sp.sparse.bsr_array,
8483
sp.sparse.csc_array,
8584
sp.sparse.csr_array,
8685
sp.sparse.coo_array,
87-
sp.sparse.bsr_matrix,
8886
sp.sparse.csc_matrix,
8987
sp.sparse.csr_matrix,
9088
sp.sparse.coo_matrix,
9189
]
9290
NO_INDEX_TEST_CONSTRUCTORS = [
91+
sp.sparse.bsr_array,
92+
sp.sparse.bsr_matrix,
9393
sp.sparse.dia_array,
9494
sp.sparse.dok_array,
9595
sp.sparse.lil_array,
@@ -110,7 +110,7 @@ def test_ensure_sparse_index_int32(constructor):
110110
def test_ensure_int32_raises(constructor):
111111
with pytest.raises(ValueError, match="too large"):
112112
rows, cols = [2, 0], [1, np.iinfo(np.int32).max + 1]
113-
if constructor._format == "csc":
113+
if "csc" in constructor.__name__:
114114
rows, cols = cols, rows
115115
A = sp.sparse.coo_array(([1.0, 2.0], (rows, cols)))
116116
sklearn.utils._sparse._ensure_sparse_index_int32(constructor(A))

0 commit comments

Comments
 (0)