How do I access the coverage database generated by coverage.py and get a list of all executed statements?

168 views Asked by At

The coverage report only shows the percentage, and I would like to know all executed statements.

Eventually, I need a map in which the key is the statement and the value is True(Executed)/False(Not Executed).

Is there any way to do this?

1

There are 1 answers

0
Ned Batchelder On BEST ANSWER

You can use the HTML report to see what statements are executed and not. You can access the data through the Coverage Data API: https://coverage.readthedocs.io/en/6.3.2/api_coveragedata.html

What will you be doing with the executed/not-executed data?