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

TST: Fix assert_raises in tests_neural_networks.py #14716

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

Merged
merged 4 commits into from
Sep 8, 2019
Merged

TST: Fix assert_raises in tests_neural_networks.py #14716

merged 4 commits into from
Sep 8, 2019

Conversation

sameshl
Copy link
Contributor

@sameshl sameshl commented Aug 22, 2019

replaced assert_raises and assert_raises_regex with pytest.raises context manager.

related to #14216

assert_raises(ValueError, clf(solver='hadoken').fit, X, y)
assert_raises(ValueError, clf(learning_rate='converge').fit, X, y)
assert_raises(ValueError, clf(activation='cloak').fit, X, y)
with pytest.raises(ValueError):
Copy link
Member

Choose a reason for hiding this comment

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

The test_params_errors test can be parameterized.

Copy link
Member

@glemaitre glemaitre left a comment

Choose a reason for hiding this comment

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

Same as other PR. Let's remove assert_raise_message as well.

Copy link
Member

@glemaitre glemaitre left a comment

Choose a reason for hiding this comment

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

Otherwise LGTM

@sameshl
Copy link
Contributor Author

sameshl commented Aug 28, 2019

@rth I am getting the same error here as #14737 (comment). Can you help me resolve the way you did here #14717 (comment)

@sameshl
Copy link
Contributor Author

sameshl commented Aug 30, 2019

@rth I have fixed the error with re.escape. I tried doing it manually but did not know how to dynamically escape string at 24508b5#diff-e9c11372db18bc93e45550418424afd2R661.

Let me know if you know how I could do it

@sameshl sameshl changed the title MANIT:fix assert_raises and in tests_neural_networks.py MANIT:fix assert_raises in tests_neural_networks.py Sep 8, 2019
@sameshl sameshl changed the title MANIT:fix assert_raises in tests_neural_networks.py MANIT Fix assert_raises in tests_neural_networks.py Sep 8, 2019
Copy link
Member

@rth rth left a comment

Choose a reason for hiding this comment

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

Thanks @sameshl !

@rth rth dismissed glemaitre’s stale review September 8, 2019 12:25

comments were addressed

@rth rth changed the title MANIT Fix assert_raises in tests_neural_networks.py TST: Fix assert_raises in tests_neural_networks.py Sep 8, 2019
@rth rth merged commit 8e310cd into scikit-learn:master Sep 8, 2019
@sameshl sameshl deleted the tests_neural_networks branch September 8, 2019 14:05
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
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.