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
feat: support coverage>=5.0 #214
Conversation
18b1139
to
98050e6
Compare
@nedbat looks like I'm getting some errors about mixing coverage versions' |
@@ -101,7 +189,14 @@ def get_arcs(analysis): | |||
if not analysis.has_arcs(): | |||
return None | |||
|
|||
branch_lines = analysis.branch_lines() | |||
if not hasattr(analysis, 'branch_lines'): | |||
# N.B. switching to the public method analysis.missing_branch_arcs |
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.
@nedbat is there anything I missed in the public coverage v5+
API which would support this? Specifically, its the following block that I couldn't work out how to do without private APIs:
for l1, l2 in analysis.arcs_executed():
if l1 in branch_lines:
# SNIP
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.
@TheKevJames let's talk about this in another place. Clearly the Coverage public API doesn't give you everything you need yet. You called out this spot, but looking at the rest of the file, there are many things you are using from coverage.py that I didn't anticipate you would need.
I've added an issue for coverage.py, let's discuss the details there: nedbat/coveragepy#921
1c4f723
to
5890f72
Compare
5890f72
to
062de68
Compare
I can't say I'm excited about this code, but at the very least this should be fully backwards compatible with how
coverage<5
+coveralls
work together. There's definitely going to need to be some future work to clean this up, but hopefully this should be enough to get folks unblocked from usingcoverage>=5.0
.