1 Star 1 Fork 2

周华健/python-httprunner-api-test

加入 Gitee
与超过 1200万 开发者一起发现、参与优秀开源项目,私有仓库也完全免费 :)
免费加入
文件
该仓库未声明开源许可证文件(LICENSE),使用请关注具体项目描述及其代码上游依赖。
克隆/下载
main.py 684 Bytes
一键复制 编辑 原始数据 按行查看 历史
zhouhuajian 提交于 2021-11-09 14:48 +08:00 . 优化allure图形化测试报告生成方式
"""
运行所有测试用例
@author : zhouhuajian
@version : v1.0
"""
import pytest
import time
import os
if __name__ == '__main__':
# 根目录
root_dir = os.path.dirname(__file__)
# 年月日_时分秒
datetime = time.strftime("%Y%m%d_%H%M%S")
# 测试报告目录
report_dir = f"{root_dir}/reports/{datetime}"
# print(datetime, root_dir, report_dir)
# exit()
pytest.main([
f'--html={report_dir}/report.html',
'--self-contained-html',
f'--alluredir={report_dir}/allure_result',
f'{root_dir}/testcases'
])
os.system(f"allure generate --report-dir {report_dir}/allure_report {report_dir}/allure_result")
Loading...
马建仓 AI 助手
尝试更多
代码解读
代码找茬
代码优化
Python
1
https://gitee.com/zhouhuajian-course/python-httprunner-api-test.git
git@gitee.com:zhouhuajian-course/python-httprunner-api-test.git
zhouhuajian-course
python-httprunner-api-test
python-httprunner-api-test
master

搜索帮助