当前位置:网站首页>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'])边栏推荐
- 【ASWC Arxml结构分解】-7-Explicit(显式)和Implicit(隐式) Sender-Receiver communication描述差异
- Datagrip error "The specified database userpassword combination is rejected..."Solutions
- Sound Signal Processing Fundamental Frequency Detection and Time-Frequency Analysis
- Fist game copyright-free music download, League of Legends copyright-free music, can be used for video creation, live broadcast
- Introduction to the basic principles, implementation and problem solving of crawler
- Json对象和Json字符串的区别
- POJ1251丛林之路题解
- Windows taskbar icon abnormal solution
- JVM:运行时数据区-PC寄存器(程序计数器)
- Create, modify and delete tables
猜你喜欢

datagrip 报错 “The specified database userpassword combination is rejected...”的解决方法

Using FiddlerScript caught poly FiddlerScript 】 【 download

Golang:go静态文件处理

MVVM项目开发(商品管理系统一)

I have three degrees, and I have five faces. I was "confessed" by the interviewer, and I got an offer of 33*15.

Fist game copyright-free music download, League of Legends copyright-free music, can be used for video creation, live broadcast

金山打字通 官网 下载

Electromagnetic compatibility introductory tutorial (6) test project

阿里云李飞飞:中国云数据库在很多主流技术创新上已经领先国外

Offer刷题——1
随机推荐
05-SDRAM: Arbitration
R语言使用gt包和gtExtras包优雅地、漂亮地显示表格数据:gtExtras包的pad_fn函数与gt::fmt函数一起用于填充包含数值的特定列、对数据列的数值进行十进制对齐(从小数点对齐)
Golang: go to connect and use mysql
LeetCode 0150. Reverse Polish Expression Evaluation
LeetCode 415:字符串相加
CSP-S2019兴奋不已
头歌MySQL数据库实训答案 有目录
电磁兼容简明教程(6)测试项目
Guest brush SQL - 2
13 - JUC CountDownLatch concurrent programming
Practical training Navicat Chinese and English mode switching
The Bean's life cycle
Dart exception details
05-SDRAM:仲裁
好的plm软件有哪些?plm软件排行榜
"By sharing" northwestern university life service | | bytes a second interview on three sides by HR
VSCode插件推荐(Rust环境)
Offer brush questions - 1
支付宝如何生成及配置公钥证书
Generate pictures based on the content of the specified area and share them with a summary