import coverage
def aadd():
class object():
pass
def work(self):
pass
def work()
cove = coverage.Coverage()
cove.start()
a = Control()
a.work()
cove.stop()
cove.html_report(directory='/root/CheetahWeb/')
转载于:https://blog.51cto.com/swq499809608/2067406