当前位置:网站首页>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'])边栏推荐
- Matlab simulink particle swarm optimization fuzzy pid control motor pump
- Using FiddlerScript caught poly FiddlerScript 】 【 download
- 监听父元素宽高,自适应插件大小
- 我三本学历,五面阿里,被面试官“供”着出来了,拿了33*15的Offer
- 从购买服务器到网站搭建成功保姆级教程~超详细
- R语言使用gt包和gtExtras包优雅地、漂亮地显示表格数据:gtExtras包的pad_fn函数与gt::fmt函数一起用于填充包含数值的特定列、对数据列的数值进行十进制对齐(从小数点对齐)
- 目标检测概述-上篇
- MATLAB program design and application of MATLAB 2.5
- Golang:go获取url和表单属性值
- LeetCode Question of the Day (309. Best Time to Buy and Sell Stock with Cooldown)
猜你喜欢

Self-made a remote control software - VeryControl

【HDLBits 刷题】Circuits(1)Combinational Logic

阿里三面:MQ 消息丢失、重复、积压问题,该如何解决?

测试工具(四)Jenkins环境搭建与使用

类似 MS Project 的项目管理工具有哪些

Srping bean in the life cycle

crypto-js uses

VSCode 快捷键及通用插件推荐

Offer刷题——1

Dbeaver connect the MySQL database and error Connection refusedconnect processing
随机推荐
我三本学历,五面阿里,被面试官“供”着出来了,拿了33*15的Offer
Detailed explanation of the crawler framework Scrapy
Monitor the width and height of the parent element, adapt to the size of the plug-in
阿里云李飞飞:中国云数据库在很多主流技术创新上已经领先国外
爆肝3万字,最硬核丨Mysql 知识体系、命令全集 【建议收藏 】
特殊的日子,值得纪念
2022杭电多校第二场1011 DOS Card(线段树)
C语言学习概览(一)
datagrip 报错 “The specified database userpassword combination is rejected...”的解决方法
CSP-S2019兴奋不已
POJ2421道路建设题解
Three aspects of Ali: How to solve the problem of MQ message loss, duplication and backlog?
企业员工人事管理系统(数据库课设)
Classwork (7) - #598. remainder operation (mod)
LeetCode 0150. Reverse Polish Expression Evaluation
app 自动化 通过工具查看app 元素 (三)
The Bean's life cycle
Leetcode第 304 场周赛
"By sharing" northwestern university life service | | bytes a second interview on three sides by HR
mysql的行锁和间隙锁