Closed starcruiseromega closed 10 months ago
Back to draft -- let me update the changes file first.
Ok, should be all set now, and I ran tox locally to make sure the tests are passing. Let me know if there's anything else I need to do for this change!
Thanks, @starcruiseromega for your PR, it's must appreciated. I'm curious to know how you are using pycobertura, if you don't mind sharing. I ask because the branch rate isn't something we use as part of the command line flow, it's more here as a convenience when people use pycobertura as a library to parse coverage reports.
Hi @aconrad ! Thanks for the merge and release, and sorry for the delay answering your question. We have an internal tool that tracks code coverage, and we use pycobertura to parse out the line coverage and branch coverage from users' reports. Most of them are generated by tools like pytest, but there are a few using languages like OCaml, for which branch coverage isn't very meaningful, so they don't have it in their reports.
If "branch-rate" isn't present in the XML, this method tries to return
float(None)
, which raises a TypeError. I believe that branch-rate isn't required, at least by the "loose" Cobertura spec, but either way it seems more useful to be less strict.