Skip to content
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

Small test improvement #1068

Open
wants to merge 4 commits into
base: main
Choose a base branch
from
Open

Small test improvement #1068

wants to merge 4 commits into from

Conversation

ogrisel
Copy link
Contributor

@ogrisel ogrisel commented Jun 16, 2020

Trying to reproduce the test_nested_exception_dispatch[loky] failure observed in #1055 as it seems unrelated to dask.

@codecov
Copy link

codecov bot commented Jun 16, 2020

Codecov Report

Merging #1068 into master will increase coverage by 0.00%.
The diff coverage is 100.00%.

Impacted file tree graph

@@           Coverage Diff           @@
##           master    #1068   +/-   ##
=======================================
  Coverage   94.45%   94.45%           
=======================================
  Files          47       47           
  Lines        6849     6851    +2     
=======================================
+ Hits         6469     6471    +2     
  Misses        380      380           
Impacted Files Coverage Δ
joblib/test/test_parallel.py 97.14% <100.00%> (+<0.01%) ⬆️
joblib/logger.py 86.84% <0.00%> (-1.32%) ⬇️
joblib/_store_backends.py 90.76% <0.00%> (-0.52%) ⬇️
joblib/parallel.py 97.00% <0.00%> (+0.54%) ⬆️

Continue to review full report at Codecov.

Legend - Click here to learn more
Δ = absolute <relative> (impact), ø = not affected, ? = missing data
Powered by Codecov. Last update ac0f152...8b0726d. Read the comment docs.

@ogrisel ogrisel changed the title [DEBUG] CI failure Small test improvement Jul 25, 2020
@GaelVaroquaux
Copy link
Member

What does this do? Should it be merged

@tomMoral
Copy link
Contributor

tomMoral commented Oct 7, 2021

I think so. As in python3, we rely on the __cause__ attribute of an exception to report the true error to the user, we should make sure it exists.

Copy link
Contributor

@tomMoral tomMoral left a comment

Choose a reason for hiding this comment

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

A small nitpick but otherwise LGTM

@@ -536,10 +536,13 @@ def test_nested_exception_dispatch(backend):
We rely on the Python 3 built-in __cause__ system that already
report this kind of information to the user.
"""
with raises(ValueError) as excinfo:
with raises((ValueError, MyExceptionWithFinickyInit)) as excinfo:
Copy link
Contributor

Choose a reason for hiding this comment

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

This will never be called as we don't pass custom_exception to the exception_raiser so probaly better to not complicate the test?

Suggested change
with raises((ValueError, MyExceptionWithFinickyInit)) as excinfo:
with raises(ValueError) as excinfo:

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.

None yet

3 participants