Skip to content

Commit df0d7ef

Browse files
author
Joao Felipe Rocha
committed
Still trying to solve the regex.
1 parent aa80694 commit df0d7ef

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

test/test_data.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -387,7 +387,7 @@ def test_inverse_transform_sparse_svd():
387387
G.inverse_transform(G.data_nu, columns=data.shape[1])
388388

389389
# Flexible regex pattern that works across Python versions
390-
sparse_error_pattern = r".*sparse.*passed, but dense data is required.*toarray\(\).*dense numpy array.*"
390+
sparse_error_pattern = r"(Sparse data|A sparse matrix) was passed, but dense data is required\. Use (?:'.*?'|X\.toarray\(\)) to convert to a dense numpy array\."
391391
with assert_raises_regex(TypeError, sparse_error_pattern):
392392
G.inverse_transform(sp.csr_matrix(G.data)[:, 0])
393393

0 commit comments

Comments
 (0)