Skip to content

MAINT Use disassembled estimator checks / fix CI #40

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 4 commits into from
Oct 27, 2019
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
31 changes: 17 additions & 14 deletions sklearn_extra/tests/test_common.py
Original file line number Diff line number Diff line change
@@ -1,20 +1,23 @@
import pytest

from sklearn.utils.estimator_checks import check_estimator
from sklearn.utils import estimator_checks

from sklearn_extra.kernel_approximation import Fastfood
from sklearn_extra.kernel_methods import _eigenpro
from sklearn_extra.kernel_methods import EigenProClassifier, EigenProRegressor
from sklearn_extra.cluster import KMedoids

ALL_ESTIMATORS = [Fastfood, KMedoids, EigenProClassifier, EigenProRegressor]

if hasattr(estimator_checks, "parametrize_with_checks"):
# Common tests are only run on scikit-learn 0.22+

@estimator_checks.parametrize_with_checks(ALL_ESTIMATORS)
def test_all_estimators(estimator, check, request):
# TODO: fix this common test failure cf #41
if isinstance(
estimator, EigenProClassifier
) and "function check_classifier_multioutput" in str(check):
request.applymarker(
pytest.mark.xfail(run=False, reason="See issue #41")
)

@pytest.mark.parametrize(
"Estimator",
[
Fastfood,
KMedoids,
_eigenpro.EigenProClassifier,
_eigenpro.EigenProRegressor,
],
)
def test_all_estimators(Estimator, request):
return check_estimator(Estimator)
return check(estimator)