框架执行入口main.py

"""
框架执行入口
"""

import unittest

from tools.handle_path import case_dir,report_name
from tools.handle_report_file import HandleReportFile
import unittestreport

#将测试报告移动到历史目录下
HandleReportFile.move_file()

#创建测试套件,其中start_dir指测试文件目录,case_dir指os.path.dirname(__file__),pattern指测试用例文件名称,默认以test.开头的py文件;
suite = unittest.defaultTestLoader.discover(start_dir=case_dir,pattern="test_6_place_order.py")

#创建执行器
runner = unittestreport.TestRunner(
                 suite=suite,
                 filename=report_name,#测试报告名称
                 report_dir="./reports",#测试报告存放路径
                 title='测试报告标题',
                 tester='测试人名称',
                 desc="接口自动化测试报告",
                 templates=1#样式模版
                 )
runner.run()
runner.send_email(
                host='smtp.qq.com',
                port=465,
                user='320597860293@qq.com',
                password='oyukpnrnjirebahb',
                to_addrs='ewhgaeiug@qq.com'
                 )


评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值