当前位置:网站首页>Pytest (3) parameterize
Pytest (3) parameterize
2022-07-02 06:33:00 【bthtth】
import pytest
datas_list = [(" Li Hua ",24),(" Zhang San ",43))
@pytest.mark.parametrize("data",datas_list)
def test_print(data):
print(" I am a {0}, This year, {1} year ".format(data[0],data[1]))
parametrize(" Parameter name ", Organize a list of data )
# Parameter name , It is used to receive the data that each group needs to transmit
# Organize a list of data , No need to add *
# Parameter name Want to be with The formal parameter names of use case functions are the same
# Compare ddt, Parameter name is not required , The list needs to add *
@ddt
@data(*datas_list)
def test_print(data)
print(" I am a {0}, This year, {1} year ".format(data[0],data[1]))
边栏推荐
猜你喜欢
华为MindSpore开源实习机试题
New version of dedecms collection and release plug-in tutorial tool
unittest.TextTestRunner不生成txt测试报告
深入学习JVM底层(三):垃圾回收器与内存分配策略
注解和反射详解以及运用
Hydration failed because the initial UI does not match what was rendered on the server.问题原因之一
代码技巧——Controller参数注解@RequestParam
ShardingSphere-JDBC篇
Summary of WLAN related knowledge points
TensorRT的数据格式定义详解
随机推荐
In depth understanding of JUC concurrency (II) concurrency theory
Vector types and variables built in CUDA
Redis---1.数据结构特点与操作
Amazon AWS data Lake Work Pit 1
Hydration failed because the initial UI does not match what was rendered on the server. One of the reasons for the problem
阿里云MFA绑定Chrome浏览器
CUDA中的动态全局内存分配和操作
实现strStr() II
找到页面当前元素z-index最高的数值
日期时间API详解
MySql索引
Redis - hot key issues
Kotlin - 验证时间格式是否是 yyyy-MM-dd HH:mm:ss
TensorRT的命令行程序
Three suggestions for all students who have graduated and will graduate
代码技巧——Controller参数注解@RequestParam
Alibaba cloud MFA binding Chrome browser
Redis——缓存击穿、穿透、雪崩
ctf-web之练习赛
Data science [9]: SVD (2)