UnitTest + HTMLTestRunner

 

#导入HTMLTestRunner类
from unitTest.tools1.HTMLTestRunner import HTMLTestRunner
import unittest


discover = unittest.defaultTestLoader.discover("./cases",pattern='test*.py')


#报告生成路径
with open("./report/ha.html","wb") as f:
    h=HTMLTestRunner(stream=f,title="测试报告",description="windows chrome")
    h.run(discover)

 

posted @ 2020-08-13 11:54  程程111  阅读(77)  评论(0编辑  收藏  举报