Skip to content

TST Uses pytest.raises in model_selection/tests #19621

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

Conversation

mohaseeb
Copy link
Contributor

@mohaseeb mohaseeb commented Mar 5, 2021

Reference Issues/PRs

References #14216.

What does this implement/fix? Explain your changes.

Replaces the use of assert_raise_message by pytest.raises in model_selection/tests/.

Any other comments?

#DataUmbrella

Copy link
Member

@ogrisel ogrisel left a comment

Choose a reason for hiding this comment

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

This PR is a good opportunity to use f-strings everywhere to format the expected exception messages. Other than that, LGTM.

Copy link
Member

@thomasjpfan thomasjpfan left a comment

Choose a reason for hiding this comment

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

Thank you for the PR @mohaseeb !

combining re.escape with f-strings is very nice !

@thomasjpfan thomasjpfan changed the title TST replaces assert_raise_message by pytest.raises in model_selection/tests/ TST Uses pytest.raises in model_selection/tests Mar 9, 2021
@thomasjpfan thomasjpfan merged commit ae3d955 into scikit-learn:main Mar 9, 2021
@glemaitre glemaitre mentioned this pull request Apr 22, 2021
12 tasks
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.

3 participants