unittest生成报告

# html报告文件路径
    report_abspath = os.path.join(report_path, "result.html")
    fp = open(report_abspath, "wb")
    runner = HTMLTestRunner.HTMLTestRunner(stream=fp,
                                           title=u'自动化测试报告,测试结果如下:',
                                           description=u'用例执行情况:')

    # 调用add_case函数返回值
    runner.run(all_case())
    fp.close()

上一篇:多线程-安全的终止线程


下一篇:docker+gitlab+gitlab-runner部署