File tree Expand file tree Collapse file tree 1 file changed +6
-8
lines changed Expand file tree Collapse file tree 1 file changed +6
-8
lines changed Original file line number Diff line number Diff line change @@ -1363,17 +1363,15 @@ def test_poisson_y_positive_check():
1363
1363
X = np .zeros ((3 , 3 ))
1364
1364
1365
1365
y = [- 1 , 1 , 3 ]
1366
- with pytest .raises (
1367
- ValueError ,
1368
- match = "Some.*y are negative.*Poisson.*\."
1369
- ):
1366
+ err_msg = (r"Some value\(s\) of y are negative which is "
1367
+ r"not allowed for Poisson regression." )
1368
+ with pytest .raises (ValueError , match = err_msg ):
1370
1369
est .fit (X , y )
1371
1370
1372
1371
y = [0 , 0 , 0 ]
1373
- with pytest .raises (
1374
- ValueError ,
1375
- match = "Sum of y is not positive.*Poisson regression\."
1376
- ):
1372
+ err_msg = (r"Sum of y is not strictly positive which "
1373
+ r"is necessary for Poisson regression." )
1374
+ with pytest .raises (ValueError , match = err_msg ):
1377
1375
est .fit (X , y )
1378
1376
1379
1377
# mypy error: Variable "DEFAULT_JOBLIB_BACKEND" is not valid type
You can’t perform that action at this time.
0 commit comments