unittest 执行测试脚本输出测试报告

import unittest
import HTMLTestRunnertest as HTMLTestRunner
#获取路径
path = './'
#创建测试套件,读取测试脚本
suite = unittest.TestLoader().discover(path,pattern="test*.py");
#打开文件,将测试报告写入文件内
with open("./report/test.html","w") as file: runner = HTMLTestRunner.HTMLTestRunner(
#测试报告页面内容
stream = file,
verbosity = 2,
tester = "baobao",
title = '测试报告',
description = 'This report output by baobao.'
);
#执行测试套件
runner.run(suite)
上一篇:ERROR 1 (HY000): Can't create/write to file '/tmp/#sql_909_0.MYI' (Errcode: 13)


下一篇:执行sql update use c#