8000 troubleshooting for CI tests for #19304 · scikit-learn/scikit-learn@6fd45b2 · GitHub
[go: up one dir, main page]

Skip to content
Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Appearance settings

Commit 6fd45b2

Browse files
committed
troubleshooting for CI tests for #19304
1 parent 168e8d3 commit 6fd45b2

File tree

1 file changed

+8
-8
lines changed

1 file changed

+8
-8
lines changed

sklearn/ensemble/tests/test_forest.py

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -1358,24 +1358,24 @@ def test_min_impurity_decrease():
13581358
# will suffice for the actual working of this param
13591359
assert tree.min_impurity_decrease == 0.1
13601360

1361+
13611362
def test_poisson_y_positive_check():
13621363
est = RandomForestRegressor(criterion="poisson")
13631364
X = np.zeros((3, 3))
13641365

13651366
y = [-1, 1, 3]
1366-
with pytest.raises(
1367-
ValueError,
1368-
match="Some.*y are negative.*Poisson.*\."
1369-
):
1367+
err_msg = (r"Some value\(s\) of y are negative which is "
1368+
r"not allowed for Poisson regression.")
1369+
with pytest.raises(ValueError, match=err_msg):
13701370
est.fit(X, y)
13711371

13721372
y = [0, 0, 0]
1373-
with pytest.raises(
1374-
ValueError,
1375-
match="Sum of y is not positive.*Poisson regression\."
1376-
):
1373+
err_msg = (r"Sum of y is not strictly positive which "
1374+
r"is necessary for Poisson regression.")
1375+
with pytest.raises(ValueError, match=err_msg):
13771376
est.fit(X, y)
13781377

1378+
13791379
# mypy error: Variable "DEFAULT_JOBLIB_BACKEND" is not valid type
13801380
class MyBackend(DEFAULT_JOBLIB_BACKEND): # type: ignore
13811381
def __init__(self, *args, **kwargs):

0 commit comments

Comments
 (0)
0