beautifulreport报告模板的使用

# coding:utf-8
import unittest   #单元测试模块
from BeautifulReport import BeautifulReport
from common.path import casePath

'''
构建测试套件,并执行测试
'''
# 构建测试集,包含src/test_case目录下的所有以test开头的.py文件
suite = unittest.defaultTestLoader.discover(start_dir=casePath,pattern='test*.py')
run = BeautifulReport(suite) #实例化BeautifulReport模块
run.report(filename='report.html',description='csreport',log_path='D:\\workspace\\thinksns\\result\\report')

    filename输出文件的名字

   description描述

   log_path报告输出的地址,不包含报告本身

 

BeautifulReport的安装见:https://www.jb51.net/article/184581.htm,也可以用pip进行安装

posted @ 2020-12-02 17:50  sriver_dl  Views(440)  Comments(0)    收藏  举报