Skip to content

Conversation

@thomasjpfan
Copy link
Member

Fixes #19414

assert_warns(SkipTestWarning, check_estimator, NuSVC())
with warnings.catch_warnings(record=True) as records:
check_estimator(NuSVC())
assert SkipTestWarning in [rec.category for rec in records]
Copy link
Member

Choose a reason for hiding this comment

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

with pytest.warns does not work in this case? Why? It's special cased in pytest?

@ogrisel ogrisel merged commit d223747 into scikit-learn:main Jul 13, 2021
samronsin pushed a commit to samronsin/scikit-learn that referenced this pull request Nov 30, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Remove the use of assert_warns and assert_warns_message from the tests

2 participants