Skip to content

Commit 9e62f1a

Browse files
authored
MAINT Use disassembled estimator checks / fix CI (#40)
1 parent 86a2339 commit 9e62f1a

File tree

1 file changed

+17
-14
lines changed

1 file changed

+17
-14
lines changed

sklearn_extra/tests/test_common.py

Lines changed: 17 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -1,20 +1,23 @@
11
import pytest
2-
3-
from sklearn.utils.estimator_checks import check_estimator
2+
from sklearn.utils import estimator_checks
43

54
from sklearn_extra.kernel_approximation import Fastfood
6-
from sklearn_extra.kernel_methods import _eigenpro
5+
from sklearn_extra.kernel_methods import EigenProClassifier, EigenProRegressor
76
from sklearn_extra.cluster import KMedoids
87

8+
ALL_ESTIMATORS = [Fastfood, KMedoids, EigenProClassifier, EigenProRegressor]
9+
10+
if hasattr(estimator_checks, "parametrize_with_checks"):
11+
# Common tests are only run on scikit-learn 0.22+
12+
13+
@estimator_checks.parametrize_with_checks(ALL_ESTIMATORS)
14+
def test_all_estimators(estimator, check, request):
15+
# TODO: fix this common test failure cf #41
16+
if isinstance(
17+
estimator, EigenProClassifier
18+
) and "function check_classifier_multioutput" in str(check):
19+
request.applymarker(
20+
pytest.mark.xfail(run=False, reason="See issue #41")
21+
)
922

10-
@pytest.mark.parametrize(
11-
"Estimator",
12-
[
13-
Fastfood,
14-
KMedoids,
15-
_eigenpro.EigenProClassifier,
16-
_eigenpro.EigenProRegressor,
17-
],
18-
)
19-
def test_all_estimators(Estimator, request):
20-
return check_estimator(Estimator)
23+
return check(estimator)

0 commit comments

Comments
 (0)