Пример #1
0
"""
============================
Author:小白31
Time:2020/7/31 23:54
E-mail:[email protected]
============================
"""
import unittest
import unittestreport
from day14ddt_opnpyxl.day14_work.testcase import test_register
suite = unittest.TestSuite()

loader = unittest.TestLoader()
# 模块加载用例
suite.addTest(loader.loadTestsFromModule(test_register))

runner = unittestreport.TestRunner(suite,filename="report.html",
                 report_dir=".",
                 title='测试报告',
                 tester='小白',
                 desc="小白执行测试生成的报告",
                 templates=1)
runner.run()

# 坑点!!
'''
1. __init__文件里面不要写代码,因为run文件执行的时候也会执行这里面的代码
2. 函数字典拆包是两个**
'''
Пример #2
0
from com_func.getpath import testpath
from com_func.confread import config
from com_func.sql_request import mysql
from com_func.env_func import env_params_init
import unittest
import unittestreport
import os

# 测试套件
test_suit = unittest.TestSuite()
# 测试加载器
test_loder = unittest.TestLoader()
# 加载加载器
test_suit.addTest(test_loder.discover(testpath.TEST_CASE_DIR_PATH))
# 预置环境账号
env_params_init()

if __name__ == "__main__":
    test_run = unittestreport.TestRunner(test_suit,
                                         tester="孙忘",
                                         desc="孙忘产生的测试报告",
                                         filename=os.path.join(
                                             testpath.REPORT_DIR_PATH,
                                             config.get("FILE_NAME",
                                                        "report")))
    test_run.run()
    test_run.send_email("smtp.qq.com", 465, "*****@*****.**",
                        "bhcppjhdtmuhbfbe", "*****@*****.**", True)
    mysql.con.close()
Пример #3
0
# Author: Alem
# Date:2020/9/3 0003 Time:17:29
# Email: [email protected]  
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
# Two roads diverged in a wood,and I 
# I took the one less traveled by, 
# And that has made all the difference. 
=========================================

"""
import unittest
import unittestreport
from common import handle_path
from common import handle_conf
from tools import tools

# tools.init_env_data()

suite = unittest.TestSuite()
loader = unittest.TestLoader()

suite.addTest(loader.discover(handle_path.CASE_PATH))
runner = unittestreport.TestRunner(suite,
                                   filename=handle_conf.Conf.get("report", "report_name"),
                                   report_dir=handle_path.REPORT_PATH,
                                   title='test_report',
                                   tester='Alem',
                                   desc="Alem_project_test_report")

runner.run()
Пример #4
0
"""
============================
Author:小白31
Time:2020/8/2 23:01
E-mail:[email protected]
============================
"""
import unittest
import unittestreport
# 创建一个测试套件
suite = unittest.TestSuite()
# 创建一个加载器
loader = unittest.TestLoader()
# 把testcase下面的测试用例添加到suite
suite.addTest(
    loader.discover(
        r"D:\py31\git_code\py31\day15excel优化和结果回写\day15home_work\testcase"))

runner = unittestreport.TestRunner(suite)
runner.run()
Пример #5
0
import unittest
# import HTMLReport
import unittestreport
from test_suite import suite_test
"""统一运行入口"""

suite = unittest.TestSuite()
suite.addTests(suite_test.test_suite())

# HTMLReport.TestRunner(
#     report_file_name='test',
#     title='xxx接口测试报告',
#     description='test',
#     thread_count=1
# ).run(suite)
unittestreport.TestRunner(
    suite,
    filename="report.html",
    report_dir=r"C:\Users\25359\PycharmProjects\llc\report",
    title='测试报告',
    tester='木森',
    desc="XX项目测试生产的报告",
    templates=1).run()