当前位置:网站首页>pytest接口自动化测试框架 | 通过标记表达式执行用例
pytest接口自动化测试框架 | 通过标记表达式执行用例
2022-07-26 11:40:00 【COCOgsta】
视频来源:B站《冒死上传!pytest接口自动化测试框架(基础理论到项目实战及二次开发)教学视频【软件测试】》
一边学习一边整理老师的课程内容及试验笔记,并与大家分享,侵权即删,谢谢支持!
附上汇总贴:pytest接口自动化测试框架 | 汇总_COCOgsta的博客-CSDN博客
pytest -m slow
这个命令会执行被装饰器@pytest.mark.slow装饰的所有测试用例
import pytest
# 失败
def test_fail01():
print("第一次失败")
assert 1==2
@pytest.mark.slow
def test_fail02():
print("第二次失败")
assert 1 == 2
@pytest.mark.slow
def test_hello():
print("第三次成功")
assert 1 == 1
需要创建main.py,并执行该py文件中的main函数
import pytest
if __name__ == '__main__':
# pytest.main(["--maxfail=2", "test_fail2.py"])
# 通过标记表达式执行
# pytest.main(["-m", "slow", "test_fail2.py"])
pytest.main(["-m", "not slow", "test_fail2.py"])边栏推荐
- 什么是Per-Title编码?
- System call capture and analysis conclusion making system call log collection system
- Big view +500 cases, software teams should improve R & D efficiency in this way!
- Database composition trigger
- Win10 uses NVM to install node, NPM, and cnpm
- Harbor2.2 quick check of user role permissions
- Modeling essay series 151 SCLC engineering experiment 4-sclc object
- 查询进阶 别名
- Server memory failure prediction can actually do this!
- Metauniverse gamefi chain game system development NFT Technology
猜你喜欢

Server memory failure prediction can actually do this!

How to use data pipeline to realize test modernization

There are various signs that apple is expected to support AV1
![[countdown 10 days] Tencent cloud audio and video special is about to meet, and the thousand yuan prize is waiting for you!](/img/a0/4910970a089cab198875944c7ae88c.png)
[countdown 10 days] Tencent cloud audio and video special is about to meet, and the thousand yuan prize is waiting for you!

Recalling Sister Feng

音视频技术开发周刊 | 255

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

Substance painter 2021 software installation package download and installation tutorial

Big view +500 cases, software teams should improve R & D efficiency in this way!

X 2 earn must rely on Ponzi startup? Where is the way out for gamefi? (top)
随机推荐
Test cases should never be used casually, recording the thinking caused by the exception of a test case
Acwing727. Diamond pattern
[communication principle] Chapter 2 -- deterministic signal
LeetCode / Scala - 两数,三数,四数,N数之和
MongoDN数据库以URL形式连接
沟通中经常用到的几个库存术语
正点原子stm32中hal库iic模拟`#define SDA_IN() {GPIOB->MODER&=~(3<<(9*2));GPIOB->MODER|=0<<9*2;}` //PB9 输入模式
Audio and video technology development weekly | 255
Query summary of SQL Server
Several inventory terms often used in communication
C language code quantity statistical tool
数据库组成 触发器
Substance Painter 2021软件安装包下载及安装教程
Modeling essay series 151 SCLC engineering experiment 4-sclc object
There are various signs that apple is expected to support AV1
[ten thousand words long text] Based on LSM tree thought Net 6.0 C # realize kV database (case version)
PyCharm是真的强
Sword finger offer 25. merge two sorted linked lists
系统调用捕获和分析完结篇制作系统调用日志收集系统
Esp8266 Arduino programming example - development environment construction (based on platformio)