当前位置:网站首页>pytest interface automation testing framework | parametrize source code analysis
pytest interface automation testing framework | parametrize source code analysis
2022-08-01 07:29:00 【COCOgsta】
Video source: Station B "Upload at risk!pytest interface automation testing framework (basic theory to project actual combat and secondary development) teaching video [software testing]"
Organize the teacher's course content and test notes while studying, and share it with everyone. The infringement will be deleted immediately. Thank you for your support!
Attach the summary post: pytest interface automation testing framework | Summary_COCOgsta's blog-CSDN blog
def paramtrize(argnames, argvalues, indirect=False, ids=None, scope=None,*, _param_mark=None):"""Add new invocations to the underlying test function using the list ofargvalues for the given argnames. Parametrization is performed duringthe collection phase. If you need to setup expensive resources see aboutsetting indirect to do it rather at test setup time.# Add a new call to the underlying test function with a list of argValues for the given argnames.During the collection phase (understood as the use case execution phase)Perform parameterization.:param argnames: (Union[str, List[str], Tuple[str, ..]]) - A comma-separatedstring denoting one or more argument names, or a list/tuple of argument strings.# Parameter names: use a comma-separated string, or a list or tuple, representing one or more parameter names:param argvalues: (Iterable[Union[_pytest.mark.structures.ParameterSet,Sequence[ojbect], object]]) -The list of argvalues determines how often a test is invoked with different argumentvalues.If only one argname was specified argvalues is a list of values. If N argnames werespecified, argvalues must be a list of N-tuples, where each tuple-element specifiesa value for its respective argname.# Argument value: only one argnames, argvalues is a list of values.When there are N argnames,Each tuple corresponds to a set of argnames, and all tuples are combined into a list:param indirect: (Union[bool, Sequence[str]]) - A list of arguments' names(subset of argnames) or a boolean. If True the list contains all names fromthe argnames. Each argvalue corresponding to an argname in this list will bepassed as request.param to its respective argname fixture function so that itcan perform more expensive setups during the setup phase of a test rather thanat collection time.# indirect: When indirect=True, if the incoming argnames is the fixture function name.# At this time, the fixutre function name will become an executable function, argvalues are used as the parameters of the fixture, and the fixture function will be executed.The final result is then stored in request.param;When indirect=False, the fixture function is only called as a parameter name to the test collection phase.What is the setup phase test setup phase?Understand it as configuring the conftest.py stageWhat is the collection phase test collection phase?understood as the use case execution phase:param ids: (Optional[Union[Iterable[Union[None, str, float, int, bool]],Callable[[Any], Optional[Object]]]]) -Sequence of (or generator for) ids for argvalues, or a callable to return part ofthe id for each argvalue.With sequences (and generators like itertools.count()) the returned ids should beof type string, int, float, bool, or None. They are mapped to the correspondingindex in argvalues. None means to use the auto-generated id.If it is a callable it will be called for each entry in argvalues,and the return value is used as part of the auto-generated id for the wholeset (where parts are joined with dashes ("-")). This is useful to provide morespecific ids for certain items, e.g. dates. Returning None will use anauto-generated id.If no ids are provided they will be generated automatically from the argvalues.# ids: a list of strings, which can be understood as a title, consistent with the number of use cases:param scope: (Optional[_Scope]) - If specified it denotes the scope of theparameters. The scope is used for grouping tests by parameter instance.It will also override any fixture-function defined scope, allowing to seta dynamic scope using test context or configuration.# If specified, indicates the range of parameters.Scopes are used to group tests by parameter instance.It will also override any fixture functionsDefined scopes that allow the use of test contexts or configuration dynamic scopes.:param _param_mark::return:"""边栏推荐
- Flink SQL - client, how to deal with the source side and to increase the target, the SQL - client including mapping table and the JOB such as
- 小程序更多的手势事件(左右滑动、放大缩小、双击、长按)
- gethostbyname \ getaddrinfo 解析域名IP地址不安全的原因
- VSCode插件推荐(Rust环境)
- 插入排序—直接插入排序和希尔排序
- 金山打字通 官网 下载
- 案例实践 --- Resnet经典卷积神经网络(Mindspore)
- VoLTE基础学习系列 | 企业语音网简述
- 表的创建、修改与删除
- Information system project managers must recite the work of the core test site (56) Configuration Control Board (CCB)
猜你喜欢
随机推荐
MVVM项目开发(商品管理系统一)
VSCode 快捷键及通用插件推荐
mysql中添加字段的相关问题
Electromagnetic compatibility introductory tutorial (6) test project
R语言使用gt包和gtExtras包优雅地、漂亮地显示表格数据:gtExtras包的pad_fn函数与gt::fmt函数一起用于填充包含数值的特定列、对数据列的数值进行十进制对齐(从小数点对齐)
POJ1287联网题解
Zero-code website development tool: WordPress
我的创作纪念日
nodetype中值1、2、3分别代表什么意思
Chapter 9 of Huawei Deep Learning Course - Convolutional Neural Network and Case Practice
微信小程序请求封装
Golang: go to connect and use mysql
目标检测概述-上篇
Vim三种模式
LeetCode240+312+394
app 自动化 打开app (二)
研发过程中的文档管理与工具
rhcsa 第三次
如何使用Photoshop合成星轨照片,夜空星轨照片后期处理方法
Chapters 6 and 7 of Huawei Deep Learning Course









