2 Star 14 Fork 8

king / ApiFramework

加入 Gitee
与超过 1200万 开发者一起发现、参与优秀开源项目,私有仓库也完全免费 :)
免费加入
克隆/下载
run.py 958 Bytes
一键复制 编辑 原始数据 按行查看 历史
king 提交于 2022-01-11 23:52 . 优化代码
# -*- coding: utf-8 -*-
"""
# @Time  : 2021/12/28 22:05
# @Author : king
# @File  : run.py
# @project: ApiPytestFramework
# @QQ : 772084279
# @Email : 772084279@qq.com
# @blog : https://ceshizhilu.blog.csdn.net/
"""
import os
import shutil
import pytest
from common_utils.api_path import auto_gen_case_path
from common_utils.case_handle import get_case_data
def run():
# 生成case在执行
if os.path.exists(auto_gen_case_path):
shutil.rmtree(auto_gen_case_path)
get_case_data()
if os.path.exists('outputs/reports/'):
shutil.rmtree(path='outputs/reports/')
# 本地调式执行
pytest.main(args=['-s', '--alluredir=outputs/reports'])
# 自动以服务形式打开报告
# os.system('allure serve outputs/reports')
# 本地生成报告
os.system('allure generate outputs/reports -o outputs/html --clean')
shutil.rmtree(auto_gen_case_path)
if __name__ == '__main__':
run()
Python
1
https://gitee.com/King15800/ApiFramework.git
git@gitee.com:King15800/ApiFramework.git
King15800
ApiFramework
ApiFramework
master

搜索帮助