Open
Description
Originally reported by space one (Bitbucket: spaceone, GitHub: spaceone)
It would be nice if the docs contain a single code snipped for how to measure a single function. Might this be possible?
from coverage import Coverage
def my_target_function():
return True
cov = Coverage()
cov.measure(my_target_function)
my_target_function()
cov.stop()
cov.report()
measure should be able to handle functions/classes/modules. I'm okay to give as second parameter the source-code-file (but I guess the function internally has a reference to it anywhere). (I think the source-code file is also only needed for the HTML report?!).