Skip to content

Commit

Permalink
FIX: cast wrong conformity score to test failure
Browse files Browse the repository at this point in the history
  • Loading branch information
Thibault Cordier committed May 5, 2023
1 parent 4f088e5 commit 23fedab
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 2 deletions.
2 changes: 1 addition & 1 deletion mapie/tests/test_classification.py
Original file line number Diff line number Diff line change
Expand Up @@ -900,7 +900,7 @@ def test_valid_cv(cv: Any) -> None:
"""Test that valid cv raises no errors."""
model = LogisticRegression(multi_class="multinomial")
model.fit(X_toy, y_toy)
mapie_clf = MapieClassifier(estimator=model, cv=cv, random_state=42)
mapie_clf = MapieClassifier(estimator=model, cv=cv)
mapie_clf.fit(X_toy, y_toy)
mapie_clf.predict(X_toy, alpha=0.5)

Expand Down
3 changes: 2 additions & 1 deletion mapie/tests/test_regression.py
Original file line number Diff line number Diff line change
Expand Up @@ -618,7 +618,8 @@ def test_wrong_not_fitted_conformity_score(cv: Any) -> None:


def test_wrong_conformity_score() -> None:
mapie_reg = MapieRegressor(conformity_score=object())
wrong_conformity_score = cast(ConformityScore, object())
mapie_reg = MapieRegressor(conformity_score=wrong_conformity_score)
with pytest.raises(
ValueError,
match=r".*Invalid conformity_score argument.*",
Expand Down

0 comments on commit 23fedab

Please sign in to comment.