1 Star 0 Fork 57

chengshun16 / pytest接口自动化框架

加入 Gitee
与超过 1200万 开发者一起发现、参与优秀开源项目,私有仓库也完全免费 :)
免费加入
该仓库未声明开源许可证文件(LICENSE),使用请关注具体项目描述及其代码上游依赖。
克隆/下载
main.py 3.14 KB
一键复制 编辑 原始数据 按行查看 历史
import pytest
import os
import shutil
from common.logger import Logger
from until.clear_results import clear_allure
if __name__ == '__main__':
Logger.info(r"""
_ooOoo_
o8888888o
88" . "88
(| -_- |)
O\ = /O
____/`---'\____
. ' \\| |// `.
/ \\||| : |||// \
/ _||||| -:- |||||- \
| | \\\ - /// | |
| \_| ''\---/'' | |
\ .-\__ `-` ___/-. /
___`. .' /--.--\ `. . __
."" '< `.___\_<|>_/___.' >'"".
| | : `- \`.;`\ _ /`;.`/ - ` : | |
\ \ `-. \_ __\ /__ _/ .-` / /
======`-.____`-.___\_____/___.-`____.-'======
`=---='
.............................................
佛祖保佑 永无BUG
.............................................
佛曰:
写字楼里写字间 写字间里程序员;
程序人员写程序 又拿程序换酒钱。
酒醒只在网上坐 酒醉还来网下眠;
酒醉酒醒日复日 网上网下年复年。
但愿老死电脑间 不愿鞠躬老板前;
奔驰宝马贵者趣 公交自行程序员。
别人笑我忒疯癫 我笑自己命太贱;
不见满街漂亮妹 哪个归得程序员?
""")
"""解决allure报告缓存和Jenkins无文件报错"""
clear_allure()
# pytest.main(['-m','smoke'])
pytest.main()
os.system(r"allure generate ./allure-results -o ./allure-report --clean")
os.system('allure open allure-report') # 打开报告
#失败重试
# • 测试失败后要重新运行n次,要在重新运行之间添加延迟时 间,间隔n秒再运行1。
# • 执行:
# • 安装:pip install pytest-rerunfailures
# • pytest -v - -reruns 5 --reruns-delay 1 —每次等1秒 重试5次
马建仓 AI 助手
尝试更多
代码解读
代码找茬
代码优化
Python
1
https://gitee.com/chengshun16/pytest-interface-automation.git
git@gitee.com:chengshun16/pytest-interface-automation.git
chengshun16
pytest-interface-automation
pytest接口自动化框架
master

搜索帮助

344bd9b3 5694891 D2dac590 5694891