Skip to content
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

Provide a supported API for access to raw data #270

Open
nedbat opened this issue Sep 29, 2013 · 2 comments
Open

Provide a supported API for access to raw data #270

nedbat opened this issue Sep 29, 2013 · 2 comments
Labels
api Changes to the public API

Comments

@nedbat
Copy link
Owner

nedbat commented Sep 29, 2013

[From Russ Magee:]

After our conversation on Twitter yesterday about Duvet, I took a look a look at making better use of coverage.py's internals. The result wasn't that bad:

beeware/duvet@15d2670

You suggested that you were would be interested in feedback on what needs to be formalised to make this sort of thing easier -- here's my 2c/wishlist:

  • Make coverage.load() raise an exception if the coverage file doesn't exist. At present it's a silent failure, covered by a catch-all exception. I've worked around this by checking if coverage.data.measured_files() is empty, but it really should be an exception IMHO.
  • Provide formal access to the list of files/modules that the coverage data spans. This could be done by either formalising the coverage.data class, or adding an entry point to coverage.data.measured_files(). Looking at the internals, however, it looks like coverage.data has some other potentially useful API endpoints, so formalizing might be the better approach.
  • Provide access to the individual file coverage/branch coverage percentage, and the overall project coverage percentage. As it stands I need to invoke coverage._analyze() and handle the resultant Numbers instances, rather than coverage.analysis()/analysis2().

@nedbat
Copy link
Owner Author

nedbat commented Jan 11, 2017

Original comment by Loic Dachary (Bitbucket: dachary, GitHub: dachary)


This was mostly implemented in the CoverageData API a few years later. @nedbat is it still relevant ?

@nedbat nedbat added api Changes to the public API and removed major labels Jan 15, 2020
@ProsperousHeart
Copy link
Contributor

Since this is so stale and may be implemented already, perhaps this is an issue to be closed?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
api Changes to the public API
Projects
None yet
Development

No branches or pull requests

2 participants