Skip to content

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