当前位置:网站首页>pytest接口自动化测试框架 | 重新运行失败用例
pytest接口自动化测试框架 | 重新运行失败用例
2022-07-26 11:40:00 【COCOgsta】
视频来源:B站《冒死上传!pytest接口自动化测试框架(基础理论到项目实战及二次开发)教学视频【软件测试】》
一边学习一边整理老师的课程内容及试验笔记,并与大家分享,侵权即删,谢谢支持!
附上汇总贴:pytest接口自动化测试框架 | 汇总_COCOgsta的博客-CSDN博客
pytest-rerunfailures是一个可以使pytest重新运行测试的插件,以消除间歇性故障。
安装要求:
需要具备以下先决条件才能使用pytest-rerunfailures:
python3.5,最高3.8或Pypy3
pytest 5.0或更高版本
目前已针对最近的5个次要pytest版本测试了该软件包。如果您使用的是较早版本的pytest,则应考虑更新或使用此软件包的较早版本之一。
安装
pip install pytest-rerunfailures
test_rerun.py
import pytest
def test_case01():
assert 1!=1
def test_case02():
assert 1 ==2
def test_case03():
assert 1 ==3
def test_case04():
assert 1 ==4main.py
import pytest
if __name__ == '__main__':
# 重新运行所有测试失败用例,请使用--reruns命令行选项,并制定要运行测试的最大次数
# pytest.main(['--reruns', "5", "test_rerun.py"])
# 要在两次重试之间增加延迟时间,请使用--reruns-delay,其中包含希望在下一次测试重新开始之前等待的秒数
pytest.main(['--reruns', "2", "--reruns-delay", "1", "test_rerun.py"])边栏推荐
- Esp8266 Arduino programming example - development environment construction (based on platformio)
- 3.2 创建菜单与游戏页面(下)
- PostgreSQL在Linux和Windows安装和入门基础教程
- Hal library IIC simulation in punctual atom STM32 `define SDA_ IN() {GPIOB->MODER&=~(3<<(9*2));GPIOB->MODER|=0<<9*2;}` // PB9 input mode
- 7月27日19:30直播预告:HarmonyOS3及华为全场景新品发布会
- 专访即构科技李凯:音视频的有趣、行业前沿一直吸引着我
- PostgreSQL in Linux and windows installation and introductory basic tutorial
- System call capture and segmentation - RING3 layer LD_ Preload mechanism for library function hijacking
- "Mongodb" mongodb high availability deployment architecture - replica set
- Sword finger offer 25. merge two sorted linked lists
猜你喜欢

微服务化解决文库下载业务问题实践

【倒计时10天】腾讯云音视频专场即将见面,千元大奖等你来拿!

Miccai2022 paper | evolutionary multi-objective architecture search framework: application in covid-19 3D CT classification

Mlx90640 infrared thermal imager temperature sensor module development notes (6)

Hal library IIC simulation in punctual atom STM32 `define SDA_ IN() {GPIOB->MODER&=~(3<<(9*2));GPIOB->MODER|=0<<9*2;}` // PB9 input mode

GA-RPN:引导锚点的建议区域网络

System call capture and analysis - modify kernel methods to add system calls

哈希表

An online duplicate of a hidden bug

What is per title encoding?
随机推荐
『MongoDB』MongoDB高可用部署架构——复制集篇(Replica Set)
Creation and modification of basic tables and data in them by SQL statements of SQL Server
c语言代码量统计工具
Wechat applet - Advanced chapter Lin UI component library source code analysis button component (I)
[ten thousand words long text] Based on LSM tree thought Net 6.0 C # realize kV database (case version)
向日葵资深产品总监技术分享:如何在AD域环境下应用
Swagger2.9.2 tutorial and swagger3.0.0 tutorial
微服务化解决文库下载业务问题实践
Recalling Sister Feng
Database composition indexes and constraints
Redis database, which can be understood by zero foundation Xiaobai, is easy to learn and use!
MILA旗下初创企业Ubenwa获得250万美元投资,研究婴儿健康AI诊断
Practice of microservice in solving Library Download business problems
pytest接口自动化测试框架 | pytest获取执行数据、pytest禁用插件
元宇宙GameFi链游系统开发NFT技术
音视频技术开发周刊 | 255
Subject 3 turns and turns
Which is faster to open a file with an absolute path than to query a database?
PostgreSQL in Linux and windows installation and introductory basic tutorial
Koin