Skip to content

Commit c448f3d

Browse files
committed
Update test
1 parent 1618707 commit c448f3d

File tree

1 file changed

+6
-6
lines changed

1 file changed

+6
-6
lines changed

tests/glm/test_glm.py

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -3209,11 +3209,8 @@ def test_cat_missing(cat_missing_method, unseen_missing, formula):
32093209
formula=formula,
32103210
fit_intercept=False,
32113211
)
3212-
if cat_missing_method == "convert" and formula:
3213-
with pytest.raises(NotImplementedError):
3214-
model.fit(X, y)
3215-
elif cat_missing_method == "fail" and not unseen_missing:
3216-
with pytest.raises(ValueError):
3212+
if cat_missing_method == "fail" and not unseen_missing:
3213+
with pytest.raises(ValueError, match="Categorical data can't have missing values"):
32173214
model.fit(X, y)
32183215
else:
32193216
model.fit(X, y)
@@ -3227,7 +3224,10 @@ def test_cat_missing(cat_missing_method, unseen_missing, formula):
32273224
assert len(model.coef_) == len(feature_names)
32283225

32293226
if cat_missing_method == "fail" and unseen_missing:
3230-
with pytest.raises(ValueError):
3227+
with pytest.raises(ValueError, match="Categorical data can't have missing values"):
3228+
model.predict(X_unseen)
3229+
elif cat_missing_method == "convert" and unseen_missing:
3230+
with pytest.raises(ValueError, match="contains unseen categories"):
32313231
model.predict(X_unseen)
32323232
else:
32333233
model.predict(X_unseen)

0 commit comments

Comments
 (0)