Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Appearance settings

Change assert from sklearn to pytest style in module linear_model/tests #19565

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

shivamgargsya
Copy link
Contributor

Reference Issues/PRs

Part of #19414 for linear_model/tests

What does this implement/fix? Explain your changes.

Removed use of assert_warns, assert_warns_message in linear_model/tests package

Any other comments?

The fix is part of complete fix for issue #19414

@shivamgargsya shivamgargsya changed the title replace assert_warns* by pytest.warns in module linear_model/tests TST replace assert_warns* by pytest.warns in module linear_model/tests Feb 25, 2021
@shivamgargsya shivamgargsya changed the title TST replace assert_warns* by pytest.warns in module linear_model/tests TST Change assert from sklearn to pytest style in module linear_model/tests Feb 25, 2021
@shivamgargsya shivamgargsya force-pushed the feature/linear_model_test_assert_warns_remove branch from 8a85f7b to 3be8587 Compare February 26, 2021 09:18
@shivamgargsya shivamgargsya changed the title TST Change assert from sklearn to pytest style in module linear_model/tests Change assert from sklearn to pytest style in module linear_model/tests Feb 26, 2021
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.

LGTM, thanks very much for the contribution!

sklearn/linear_model/tests/test_omp.py Outdated Show resolved Hide resolved
Copy link
Member

@lorentzenchr lorentzenchr left a comment

Choose a reason for hiding this comment

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

LGTM. We can merge with or without my one suggestion.
@shivamgargsya Thanks.

Comment on lines 1197 to 1221
warning_messages = {
'newton-cg': (
"newton-cg failed to converge. Increase the"
" number of iterations."
),
'liblinear': (
"Liblinear failed to converge, increase the"
" number of iterations."
),
'sag': (
"The max_iter was reached which means the"
" coef_ did not converge"
),
'saga': (
"The max_iter was reached which means the"
" coef_ did not converge"
),
'lbfgs': (
r"lbfgs failed to converge .*[\n]*.*[\n]*"
r"Increase the number of iterations.*"
r"or scale the data.*[\n]*.*[\n]*"
r"Please also refer to the documentation "
r"for alternative solver options.*[\n]*.*"
)
}
Copy link
Member

Choose a reason for hiding this comment

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

I would prefer to @pytest.mark.parametrize this test with max_iter, multi_class and [solver, message].

Copy link
Member

@jeremiedbb jeremiedbb left a comment

Choose a reason for hiding this comment

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

lgtm. I directly pushed the requested changes. I'll merge on green. Thanks @shivamgargsya !

@jeremiedbb jeremiedbb merged commit 5ccfabf into scikit-learn:main Mar 12, 2021
marrodion pushed a commit to marrodion/scikit-learn that referenced this pull request Mar 17, 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.

4 participants
Morty Proxy This is a proxified and sanitized view of the page, visit original site.