Skip to content

Commit 1e8a5b8

Browse files
authored
TST Fix test_clone_sparse_matrices on scipy dev (scikit-learn#26556)
1 parent 0e253d9 commit 1e8a5b8

File tree

1 file changed

+3
-1
lines changed

1 file changed

+3
-1
lines changed

sklearn/tests/test_base.py

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -188,7 +188,9 @@ def test_clone_nan():
188188

189189
def test_clone_sparse_matrices():
190190
sparse_matrix_classes = [
191-
getattr(sp, name) for name in dir(sp) if name.endswith("_matrix")
191+
cls
192+
for name in dir(sp)
193+
if name.endswith("_matrix") and type(cls := getattr(sp, name)) is type
192194
]
193195

194196
for cls in sparse_matrix_classes:

0 commit comments

Comments
 (0)