suvayu
suvayu

Reputation: 4664

Using the Coverage Python API to get coverage results after a run

I want to generate a Markdown report after a coverage run, so I tried to use the Python API, particularly the CoverageData class. I can get the lines covered with CoverageData.lines(<file>), however I don't see how to get the percentage. Any pointers?

Upvotes: 0

Views: 454

Answers (1)

Ned Batchelder
Ned Batchelder

Reputation: 375854

You should use the coverage json command to get a JSON data file, then process it however you like. It will be easier than using the API.

Upvotes: 3

Related Questions