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 replace assert_raises by pytest.raises in test_least_angle, test_omp, test_test_theil_sen #19406

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 9 commits into from
Apr 9, 2021

Conversation

abdulelahsm
Copy link
Contributor

Reference Issues/PRs

Fixes #14216

What does this implement/fix? Explain your changes.

test_least_angle, test_omp, test_test_theil_sen (all .py files)

replaced assert_raises with pytest.error()

Any other comments?

@glemaitre glemaitre changed the title fix test_least_angle, test_omp, test_test_theil_sen TST replace assert_raises by pytest.raises in test_least_angle, test_omp, test_test_theil_sen Feb 9, 2021
@glemaitre glemaitre self-requested a review February 9, 2021 16:08
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.

Could you make the following changes

sklearn/linear_model/tests/test_least_angle.py Outdated Show resolved Hide resolved
sklearn/linear_model/tests/test_omp.py Outdated Show resolved Hide resolved
sklearn/linear_model/tests/test_theil_sen.py Outdated Show resolved Hide resolved
sklearn/linear_model/tests/test_theil_sen.py Outdated Show resolved Hide resolved
sklearn/linear_model/tests/test_theil_sen.py Outdated Show resolved Hide resolved
sklearn/linear_model/tests/test_theil_sen.py Outdated Show resolved Hide resolved
sklearn/linear_model/tests/test_theil_sen.py Outdated Show resolved Hide resolved
@glemaitre
Copy link
Member

Be aware that the context manager is pytest.raises and not pytest.error. You can read the failure in the "Details" of azure.
You can as well run the test locally using pytest. This would have give you the same error message.

@Mariam-ke
Copy link
Contributor

#DataUmbrella sprint
cc: @reshamas

@Mariam-ke
Copy link
Contributor

#DataUmbrella

@ogrisel
Copy link
Member

ogrisel commented Feb 18, 2021

For your information, I just fixed a repeated typo in @glemaitre's suggestions.

@abdulelahsm are you still interested in finalizing this PR? Can you please address @glemaitre's comments and update this pull request accordingly?

Make sure that the tests pass by reading the error messages of the test execution reports accessible via the "Details" links:

Screenshot 2021-02-18 at 18 19 46

@abdulelahsm
Copy link
Contributor Author

abdulelahsm commented Feb 23, 2021

For your information, I just fixed a repeated typo in @glemaitre's suggestions.

@abdulelahsm are you still interested in finalizing this PR? Can you please address @glemaitre's comments and update this pull request accordingly?

Make sure that the tests pass by reading the error messages of the test execution reports accessible via the "Details" links:

Screenshot 2021-02-18 at 18 19 46

Thanks a lot for your help. Yes I'll wrap it up soon @ogrisel

@Mariam-ke
Copy link
Contributor

@abdulelahsm How is this PR going? Please let us know if we can answer any questions.

cc: @reshamas

@abdulelahsm
Copy link
Contributor Author

@abdulelahsm How is this PR going? Please let us know if we can answer any questions.

cc: @reshamas

Hey, I made the required changes but I'm trying to understand why the tests are failing

@abdulelahsm
Copy link
Contributor Author

@ogrisel hey Oliver, are these merge conflict errors something that I could fix? my branch is up to date using fetch upstream

@ogrisel
Copy link
Member

ogrisel commented Mar 13, 2021

@ogrisel hey Oliver, are these merge conflict errors something that I could fix? my branch is up to date using fetch upstream

You need to merge the main branch from the upstream repo into the fix_assert_raises branch of your local repo, and resolve the conflicts doing so. Then push the fix_assert_raises to your github repo/fork.

assert (orthogonal_mp_gram(G, Xy, n_nonzero_coefs=5).shape ==
(n_features, 3))
Copy link
Member

Choose a reason for hiding this comment

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

It's ok for this time, but next time please try to refrain to change the formatting of the lines that are fare away from the real changes of your PR to keep the review focused on the main topic (and keep the git history meaningful).

Copy link
Contributor Author

Choose a reason for hiding this comment

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

I apologize, I have a lot to learn and I appreciate your time and effort. Thank you for the valuable feedback

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.

Minor comment but otherwise LGTM.

sklearn/linear_model/tests/test_omp.py Outdated Show resolved Hide resolved
Co-authored-by: Olivier Grisel <olivier.grisel@ensta.org>
sklearn/linear_model/tests/test_least_angle.py Outdated Show resolved Hide resolved
@glemaitre glemaitre self-requested a review April 9, 2021 09:30
Co-authored-by: Chiara Marmo <cmarmo@users.noreply.github.com>
@glemaitre glemaitre merged commit 02e2a11 into scikit-learn:main Apr 9, 2021
@glemaitre
Copy link
Member

Thanks @abdulelahsm

thomasjpfan pushed a commit to thomasjpfan/scikit-learn that referenced this pull request Apr 19, 2021
…omp, test_test_theil_sen (scikit-learn#19406)

Co-authored-by: Olivier Grisel <olivier.grisel@gmail.com>
Co-authored-by: Olivier Grisel <olivier.grisel@ensta.org>
Co-authored-by: Guillaume Lemaitre <g.lemaitre58@gmail.com>
Co-authored-by: Chiara Marmo <cmarmo@users.noreply.github.com>
@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.

Remove the use of assert_raises and assert_raises_regex from the tests
5 participants
Morty Proxy This is a proxified and sanitized view of the page, visit original site.