Skip to content

Commit cf09ebd

Browse files
authored
[MRG] Fix test after sklearn update where the text of a Value error changed (#303)
* add contributor guide * fix test after sklearn update * fix test after sklearn update
1 parent 19a8e7d commit cf09ebd

File tree

1 file changed

+7
-2
lines changed

1 file changed

+7
-2
lines changed

skada/tests/test_utils.py

Lines changed: 7 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -421,13 +421,16 @@ def test_check_X_domain_multi_nd():
421421
check_X_domain(X, sample_domain=sample_domain, allow_nd=True)
422422

423423
# Test with allow_nd=False (should raise an error)
424-
with pytest.raises(ValueError, match="Found array with dim 3. None expected <= 2."):
424+
with pytest.raises(
425+
ValueError, match="Found array with dim 3, while dim <= 2 is required."
426+
):
425427
check_X_domain(X, sample_domain=sample_domain, allow_nd=False)
426428

427429

428430
def test_check_X_y_domain_multi_nd():
429431
# Create a 3D array for X (10 samples, 2 features, 3 channels)
430432
X = np.random.rand(10, 2, 3)
433+
431434
# Create a 2D array for y (10 samples, 2 outputs)
432435
y = np.random.rand(10, 2)
433436
sample_domain = np.array([1] * 5 + [-1] * 5)
@@ -436,7 +439,9 @@ def test_check_X_y_domain_multi_nd():
436439
check_X_y_domain(X, y, sample_domain=sample_domain, allow_nd=True)
437440

438441
# Test with allow_nd=False (should raise an error for X)
439-
with pytest.raises(ValueError, match="Found array with dim 3. None expected <= 2."):
442+
with pytest.raises(
443+
ValueError, match="Found array with dim 3, while dim <= 2 is required."
444+
):
440445
check_X_y_domain(X, y, sample_domain=sample_domain, allow_nd=False)
441446

442447

0 commit comments

Comments
 (0)