You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Hi! Eleanor from the Python for VS Code extension following up on API updates I was hoping to get which the VS Code python extension needs to support branch coverage! As you know, right now there is no way to get branch coverage from the API so Im looking to implement this but wanted to start the discussion as an issue to make sure I have the right approach.
What I think is the easiest access point to the branch coverage values I am looking for is in the Analysis class. Here there is the function _total_branches() which would provide one value I need and then I would need either covered branches or missing branches. n_missing_branches is defined in the Analysis class but not accessible, so maybe a getter for this value would be sufficient. (it is my understanding that branches are different from arcs and therefore it is not sufficient to display arc values but if I am mistaken please let me know)
Next is getting the Analysis class instance for a given file. From what I can tell, it seems like this is returned in two places, _analyze or analysis_from_file_reporter, (which makes sense given that _analyze calls analysis_from_file_reporter). It seems like _analyze under the Coverage class is probably easiest, given the comment "Private for now." in its docstring this might have been something already considered.
To summarize, what I am suggesting is:
making the Analysis class part of the API
adding the _analyze function in Coverage to the API
adding a function to Analysis to surface either covered branches or missing branches
These are quite a few asks so if you have a suggestion that might add less to the API (and less to maintain) please let me know. It is not my intent to bloat the API only get these branch numbers so we could also attempt edits to surface them without the Analysis data class but I am unsure.
For context, here is where we collect and transform coverage in the extension. Here was my previous idea on how to get branch coverage before I realized it was not part of the API.
Thank you!
The text was updated successfully, but these errors were encountered:
Hi! Eleanor from the Python for VS Code extension following up on API updates I was hoping to get which the VS Code python extension needs to support branch coverage! As you know, right now there is no way to get branch coverage from the API so Im looking to implement this but wanted to start the discussion as an issue to make sure I have the right approach.
What I think is the easiest access point to the branch coverage values I am looking for is in the Analysis class. Here there is the function
_total_branches()
which would provide one value I need and then I would need either covered branches or missing branches.n_missing_branches
is defined in theAnalysis
class but not accessible, so maybe a getter for this value would be sufficient. (it is my understanding that branches are different from arcs and therefore it is not sufficient to display arc values but if I am mistaken please let me know)Next is getting the
Analysis
class instance for a given file. From what I can tell, it seems like this is returned in two places, _analyze or analysis_from_file_reporter, (which makes sense given that_analyze
callsanalysis_from_file_reporter
). It seems like_analyze
under theCoverage
class is probably easiest, given the comment "Private for now." in its docstring this might have been something already considered.To summarize, what I am suggesting is:
Analysis
class part of the API_analyze
function inCoverage
to the APIThese are quite a few asks so if you have a suggestion that might add less to the API (and less to maintain) please let me know. It is not my intent to bloat the API only get these branch numbers so we could also attempt edits to surface them without the Analysis data class but I am unsure.
For context, here is where we collect and transform coverage in the extension. Here was my previous idea on how to get branch coverage before I realized it was not part of the API.
Thank you!
The text was updated successfully, but these errors were encountered: