Show unverified features with reach

with coverage , I can get the percentage of unverified functions

coverage run setup.py test ; coverage report 

like this

 Name Stmts Miss Cover ------------------------------------------------- script 565 278 51% setup 6 0 100% ... 

How can I get the name of unverified functions?

+6
source share
1 answer

If you run coverage report -m , it will display the uncovered rows in the output under the missing column:

 Name Stmts Miss Cover Missing ------------------------------------------------------- my_program 20 4 80% 33-35, 39 my_other_module 56 6 89% 17-23 ------------------------------------------------------- TOTAL 76 10 87% 

If you run coverage html , it will create a web page where you can browse your source and see that the uncovered lines are highlighted in a special color.

If you are looking for your own processing on uncovered strings, you can run coverage xml and it will generate an XML file containing the missing strings.

If you really need name functions, and not just line numbers (for example, you want all functions to contain at least one uncovered line), you will need to extract this yourself by reading the source and the xml report and processing them using your own program .

+11
source

All Articles