TST Uses pytest fixtures in tests when using fetch_ dataset loaders #19166
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Reference Issues/PRs
Follow up for #19118
What does this implement/fix? Explain your changes.
#19118 added a feature to detect
fetch_*
through its fixtures. This detection is used to enable downloading the datasets serially when they are being used in the tests. This functionally requires that all tests uses these fixtures instead of importing directly fromsklearn.dataset
. This PR updatessklearn/datasets/tests/test_common.py
to use the fixtures.A second benefit of this PR is that it centralizes the handling of
SKLEARN_SKIP_NETWORK_TESTS
into one file. (sklearn/conftest.py
)