-
-
Notifications
You must be signed in to change notification settings - Fork 457
Open
Labels
apiChanges to the public APIChanges to the public APIenhancementNew feature or requestNew feature or request
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?!).
Metadata
Metadata
Assignees
Labels
apiChanges to the public APIChanges to the public APIenhancementNew feature or requestNew feature or request