-
Notifications
You must be signed in to change notification settings - Fork 907
Skip code coverage for specific dask lines #1829
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
| except AttributeError: # pragma: no cover | ||
| cpus = psutil.cpu_count() # pragma: no cover |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I believe you can put # pragma: no cover at the top of any block and it prevents tracking coverage for all lines in that block. So you wouldn't need the pragma on line 1242. I think this also works for functions.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Fixed:
4492edc
| approximate='1 hour') | ||
|
|
||
|
|
||
| def test_warning_not_enough_chunks(pd_es, capsys, three_worker_scheduler): |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I believe you can put a single # pragma: no cover at the end of this line and avoid putting one on each line of the function body.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Fixed:
4492edc
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Did this section get updated? I'm seeing that the function still has a pragma no cover on each line.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Sorry, fixed:
a1ac50e
featuretools/computational_backends/calculate_feature_matrix.py
Outdated
Show resolved
Hide resolved
featuretools/tests/computational_backend/test_calculate_feature_matrix.py
Outdated
Show resolved
Hide resolved
| approximate='1 hour') | ||
|
|
||
|
|
||
| def test_warning_not_enough_chunks(pd_es, capsys, three_worker_scheduler): |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Did this section get updated? I'm seeing that the function still has a pragma no cover on each line.
Codecov Report
@@ Coverage Diff @@
## main #1829 +/- ##
==========================================
+ Coverage 98.74% 98.79% +0.04%
==========================================
Files 142 142
Lines 15841 15820 -21
==========================================
- Hits 15642 15629 -13
+ Misses 199 191 -8
Continue to review full report at Codecov.
|
rwedge
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think we should make an issue to figure out why sometimes the entire test_warning_not_enough_chunks is uncovered
| es, | ||
| verbose=True) | ||
| assert False | ||
| assert False # pragma: no cover |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
can this line reasonably be hit?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Are you suggesting we take out the line completely?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
It could be that this assertion was placed here to indicate that whatever comes before it is intended to cover all cases. I sometimes do this, for example, if I have a string of if statements that are meant to cover all the possible types of values that might be passed to a function. Then, I'll include a final else: that just has something like raise Exception("invariant") or assert False. It shows very clearly that the if statements were supposed to handle any kind of value that came in and that they should have explicitly listed out the supported value types.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Fixed with pytest.raises:
82baa04
davesque
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks for making those changes! Looks good to me.
rwedge
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM
Uh oh!
There was an error while loading. Please reload this page.