Skip to content

Commit aa80694

Browse files
author
Joao Felipe Rocha
committed
Have to change the way we assert. Corrected it now
1 parent 477d3b9 commit aa80694

File tree

1 file changed

+4
-8
lines changed

1 file changed

+4
-8
lines changed

test/test_data.py

Lines changed: 4 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -388,16 +388,12 @@ def test_inverse_transform_sparse_svd():
388388

389389
# Flexible regex pattern that works across Python versions
390390
sparse_error_pattern = r".*sparse.*passed, but dense data is required.*toarray\(\).*dense numpy array.*"
391-
with assert_raises_message(
392-
TypeError,
393-
sparse_error_pattern,
394-
):
391+
with assert_raises_regex(TypeError, sparse_error_pattern):
395392
G.inverse_transform(sp.csr_matrix(G.data)[:, 0])
396-
with assert_raises_message(
397-
TypeError,
398-
sparse_error_pattern,
399-
):
393+
394+
with assert_raises_regex(TypeError, sparse_error_pattern):
400395
G.inverse_transform(sp.csr_matrix(G.data)[:, :15])
396+
401397
with assert_raises_message(
402398
ValueError,
403399
"data of shape ({0},) cannot be inverse transformed from graph built on reduced data of shape ({0}, {1}). Expected shape ({0}, {1})".format(

0 commit comments

Comments
 (0)