Skip to content

TST be more specific in test_estimator_checks #29834

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 3 commits into from
Sep 12, 2024

Conversation

adrinjalali
Copy link
Member

This doesn't add or remove any tests. It simply extracts a few tests into their own tests/functions, and uses the specific test instead of calling check_estimator which makes them resistant to changes in test orders and adding tests to check_estimator.

cc @adam2392 @Charlie-XIAO

@adrinjalali adrinjalali added No Changelog Needed Developer API Third party developer API related labels Sep 11, 2024
Copy link

github-actions bot commented Sep 11, 2024

✔️ Linting Passed

All linting checks passed. Your pull request is in excellent shape! ☀️

Generated for commit: 339fac0. Link to the linter CI: here

Copy link
Member

@glemaitre glemaitre left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think it makes sense. When we only add check_estimator it was potentially great to make sure that we get the right error calling check_estimator. Now that we use the parametrization, this is much better to have atomic tests as in this PR.

Copy link
Member

@adam2392 adam2392 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM!

Copy link
Contributor

@Charlie-XIAO Charlie-XIAO left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM, but I was wondering why for some of the tests name is "test" while for others name is the estimator name? Do we want to be consistent here though it may not really matter?

@adrinjalali
Copy link
Member Author

The name only matters when we check exact values of raised exceptions, otherwise it really doesn't matter.

@adrinjalali adrinjalali enabled auto-merge (squash) September 12, 2024 14:20
@adrinjalali adrinjalali merged commit c24a3f9 into scikit-learn:main Sep 12, 2024
28 checks passed
@adrinjalali adrinjalali deleted the tests/test_checks branch September 12, 2024 14:41
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants