1 Star 0 Fork 2

linuxlavender/jiekou-python3

forked from 卢书锦/jiekou-python3 
加入 Gitee
与超过 1200万 开发者一起发现、参与优秀开源项目,私有仓库也完全免费 :)
免费加入
文件
该仓库未声明开源许可证文件(LICENSE),使用请关注具体项目描述及其代码上游依赖。
克隆/下载
run_html.py 1.46 KB
一键复制 编辑 原始数据 按行查看 历史
雷子 提交于 2020-11-22 11:23 . 修改bug
# -*- coding: utf-8 -*-
# @Author : leizi
import unittest, os, datetime, time
from testCase.case import testinterface
from Public.py_Html import createHtml
from Public.get_excel import datacel
from Public.emmail import sendemali
from Public.create_report import save_result
import threading
def stast():
starttime = datetime.datetime.now()
day = time.strftime("%Y%m%d%H%M", time.localtime(time.time()))
path = os.getcwd() + '//test_case_data//case.xlsx'
basdir = os.path.abspath(os.path.dirname(__file__))
listid, listkey, listconeent, listurl, listfangshi, listqiwang, listname = datacel(path)
listrelust, list_fail, list_pass, list_json, list_exption, list_weizhi= testinterface()
filepath = os.path.join(basdir + '//test_Report//%s-result.html' % day)
if os.path.exists(filepath) is False:
os.system(r'touch %s' % filepath)
save_result(starttime, len(listrelust), ((list_pass)), list_fail)
endtime = datetime.datetime.now()
createHtml(titles='接口测试报告', filepath=filepath, starttime=starttime,
endtime=endtime, passge=list_pass, fail=list_fail,
id=listid, name=listname, key=listkey, coneent=listconeent, url=listurl, meth=listfangshi,
yuqi=listqiwang, json=list_json, relusts=listrelust,exceptions=list_exption,weizhi=list_weizhi)
# sendemali(filepath)
def tThread():
m = threading.Thread(target=stast, args=())
m.run()
if __name__ == '__main__':
tThread()
Loading...
马建仓 AI 助手
尝试更多
代码解读
代码找茬
代码优化
1
https://gitee.com/linuxlavender/jiekou-python3.git
[email protected]:linuxlavender/jiekou-python3.git
linuxlavender
jiekou-python3
jiekou-python3
master

搜索帮助