当前位置:网站首页>pytest接口自动化测试框架 | parametrize叠加使用
pytest接口自动化测试框架 | parametrize叠加使用
2022-08-01 07:12:00 【COCOgsta】
视频来源:B站《冒死上传!pytest接口自动化测试框架(基础理论到项目实战及二次开发)教学视频【软件测试】》
一边学习一边整理老师的课程内容及试验笔记,并与大家分享,侵权即删,谢谢支持!
附上汇总贴:pytest接口自动化测试框架 | 汇总_COCOgsta的博客-CSDN博客
import pytest
@pytest.mark.parametrize('a,b,c', [(1,1,1),(2,2,0),(3,3,1),(4,4,0)],
ids=['用例一','用例二','用例三','用例四'])
def test_1(a,b,c):
print(a,b,c)
"""
1.叠加使用和不叠加使用同时存在时,优先叠加使用
2.叠加后,ids也会叠加
3.叠加后,ids显示顺序是下面的叠加在上面的前面
4.参数执行顺序是(a=11,b=21,c=31),(a=12,b=21,c=31),(a=11,b=22,c=32),(a=12,b=22,c=32)
"""
@pytest.mark.parametrize('a', [11,12],ids=['1叠加','2叠加'])
@pytest.mark.parametrize('b,c', [(21,31),(22,32)],ids=['3叠加','4叠加'])
def test_1(a,b,c):
print(a,b,c)
if __name__ == '__main__':
pytest.main(['-v','-s', 'test_overlay.py'])
边栏推荐
- 插入排序—直接插入排序和希尔排序
- Leetcode第 304 场周赛
- 「面经分享」西北大学 | 字节 生活服务 | 一面二面三面 HR 面
- 图片无损压缩软件哪个好用:试试完全免费的JPG-C 图片批量修整压缩减肥工具吧 | 最新jpg批量修整工具下载
- special day to remember
- Self-made a remote control software - VeryControl
- 【ASWC Arxml结构分解】-7-Explicit(显式)和Implicit(隐式) Sender-Receiver communication描述差异
- Dart 异常详解
- Srping中bean的生命周期
- 05-SDRAM:仲裁
猜你喜欢
Dbeaver connect the MySQL database and error Connection refusedconnect processing
How to generate and configure public key certificate in Alipay
MVVM project development (commodity management system 1)
自制一款远程控制软件——VeryControl
爆肝3万字,最硬核丨Mysql 知识体系、命令全集 【建议收藏 】
Explosive 30,000 words, the hardest core丨Mysql knowledge system, complete collection of commands [recommended collection]
LeetCode 415:字符串相加
Matlab simulink particle swarm optimization fuzzy pid control motor pump
从购买服务器到网站搭建成功保姆级教程~超详细
crypto-js使用
随机推荐
奇葩问题 npm install 报错 gyp ERR
牛客刷SQL---2
Motion analysis and parameter optimization of crank-slider mechanism
special day to remember
How JS works
JVM: Runtime Data Area - PC Register (Program Counter)
Image lossless compression software which works: try completely free JPG - C image batch finishing compression reduces weight tools | latest JPG batch dressing tools download
POJ2421道路建设题解
插入排序—直接插入排序和希尔排序
金山打字通 官网 下载
点餐系统数据库设计--SQL Server
Golang:go连接和使用mysql
Does flinkcdc have any solution for mysql's date field type conversion?
crypto-js uses
Golang:go静态文件处理
从零开始—仿牛客网讨论社区项目(一)
LabVIEW中局部变量和全局变量的分配
数据机构----线性表之单向链表
Golang:go获取url和表单属性值
上课作业(7)——#598. 取余运算(mod)