-
-
Notifications
You must be signed in to change notification settings - Fork 188
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
Report partially covered branches as not covered #121
Conversation
The failures seem to be from dependencies, not my code, right? |
Too bad, hopefully you find someone to take over. If not, I may fork this with a subset of the functionality. |
Hey there! This repo just underwent a change in maintainers -- myself and @goanpeca will be taking over this project. Give us some time to get up-to-speed and we'll make sure to take a look at this PR soon. |
6bb7e34
to
84e3635
Compare
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.
Other than the comment I left, this looks good to me. @goanpeca thoughts?
'coverage': [None, None, None, 1, 1, None, None, 1, None, None, None, 1, 0, None, 1, 1, 1, 0, 1]}, results[0]) | ||
assert_coverage({ | ||
'source': "# coding: utf-8\nfrom project import hello, branch\n\nif __name__ == '__main__':\n hello()\n branch(False, True)\n branch(True, True)", | ||
'name': 'runtests.py', 'coverage': [None, 1, None, 0, 1, 1, 1]}, results[1]) |
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.
Any idea why this is [None, 1, None, 0, 1, 1, 1]
when it is [None, 1, None, 1, 1, 1, 1]
in the test above (diff: if __name__
line 1->0)?
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.
Because __name__
is "__main__"
so only the condition being true gets tested. That is the difference with branch coverage enabled that it is meant to test.
It looks good @TheKevJames, but no time to test it right now |
Since coverage.io does not currently support branch coverage separately, I would like to mark those lines with only partial branch coverage as not covered.
If branch coverage is collected, this marks partially covered lines as not covered. If this implicit approach is not preferred, I could add an option for enabling this.
This change is