-
-
Notifications
You must be signed in to change notification settings - Fork 25.8k
TST add a few more tests to API checks #29832
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
TST add a few more tests to API checks #29832
Conversation
Fail is bogus, need #29834 to fix the issues here. |
sklearn/utils/estimator_checks.py
Outdated
yield check_estimator_repr | ||
yield check_no_attributes_set_in_init | ||
yield check_fit_score_takes_y | ||
yield check_estimators_overwrite_params | ||
yield check_dont_overwrite_parameters | ||
yield check_estimators_fit_returns_self | ||
yield partial(check_estimators_fit_returns_self, readonly_memmap=True) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Would something like a separate function be good _yield_joblib_compatability_checks
or would that be confusing?
My impression upon skimming the code is that some of these checks ensure joblib compatability, but might also ensure some API compliance?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Right, since this has to do with parallelisation, it's certainly API since it's needed for our meta-estimators. Creating a separate test name for it.
sklearn/utils/estimator_checks.py
Outdated
yield check_estimator_repr | ||
yield check_no_attributes_set_in_init | ||
yield check_fit_score_takes_y | ||
yield check_estimators_overwrite_params | ||
yield check_dont_overwrite_parameters | ||
yield check_estimators_fit_returns_self | ||
yield partial(check_estimators_fit_returns_self, readonly_memmap=True) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Right, since this has to do with parallelisation, it's certainly API since it's needed for our meta-estimators. Creating a separate test name for it.
@@ -753,10 +753,6 @@ def test_check_estimator(): | |||
msg = "object has no attribute 'fit'" | |||
with raises(AttributeError, match=msg): | |||
check_estimator(BaseEstimator()) | |||
# check that fit does input validation | |||
msg = "Did not raise" |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
now that we assert the right message, it became clear that this was already tested in another test and was redundant.
I think I've addressed questions and suggestions. Ready for another review. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM
@OmarManzoor maybe? |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM.
This adds a few more tests to our API checks.
I'm not 100% sure about these two though:
WDYT @glemaitre @adam2392 ?