报告生成
#导包
import unittest
#定义测试套件
suite=unittest.defaultTestLoader.discover("./")
#执行
#不会自动生成../report.report02该文件
with open("../report/report02","w",encoding="utf-8") as f:
unittest.TextTestRunner(stream=f,descriptions="跳过测试报告演示",verbosity=2).run(suite)
#导包
import unittest
from tools.HTMLTestRunner import HTMLTestRunner
#定义测试套件
suite=unittest.defaultTestLoader.discover("./")
#执行
#不会自动生成../report.report02该文件
with open("../report/report02.html","wb") as f:
HTMLTestRunner(stream=f).run(suite)