[MRG] TST Remove test_import_sklearn_no_warnings #12244
Merged
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.
This removes the
test_import_sklearn_no_warnings
added in #11431 (by me) as it is indeed of limited use.In the original motivation was to detect when importing scikit-learn or one of the top level modules produces warning. However since warnings can be due to causes outside our control (same as e.g. for our DeprecationWarning detection) it was decided to only warn in this case instead of failing. So currently this has as much values as the warnings caught during collection time in the logs. And the new pytest warning capture at collection time could be used to achieve the same effect better.
Incidentally this also lead to one PyPy test failure in #12243 (because of the exceptions handling that's not general enough in this test). I think it might be also worth back-porting this to 0.20.1 to reduce the risk of this test failing in other environments..
TBH, both reviewers found this test dubious at the time, and I heard another similar opinion post-merge.