当前位置:网站首页>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:"""边栏推荐
- Golang:go连接和使用mysql
- 我的创作纪念日
- Data organization -- singly linked list of the linear table
- 国内外最顶级的8大plm项目管理系统
- Golang: go open web service
- Golang:go获取url和表单属性值
- 05-SDRAM:仲裁
- Image lossless compression software which works: try completely free JPG - C image batch finishing compression reduces weight tools | latest JPG batch dressing tools download
- VoLTE基础学习系列 | 企业语音网简述
- 云原生FAQ
猜你喜欢

Detailed explanation of the crawler framework Scrapy

LevelSequence源码分析

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

22牛客多校1 J.Serval and Essay (启发式合并)
![Explosive 30,000 words, the hardest core丨Mysql knowledge system, complete collection of commands [recommended collection]](/img/7f/08b323ffc5b5f8e3354bee6775b994.png)
Explosive 30,000 words, the hardest core丨Mysql knowledge system, complete collection of commands [recommended collection]

金山打字通 官网 下载

Case practice --- Resnet classic convolutional neural network (Mindspore)

Upgrade to heavyweight lock, lock reentrancy will lead to lock release?

VSCode 快捷键及通用插件推荐

我说过无数遍了:从来没有一种技术是为灵活组合这个目标而设计的
随机推荐
第02章 MySQL的数据目录【1.MySQL架构篇】【MySQL高级】
【手撕AHB-APB Bridge】~ AHB地址总线的低两位为什么不用来表示地址呢?
pytest接口自动化测试框架 | 执行失败跳转pdb
2022杭电多校第二场1011 DOS Card(线段树)
【MySQL】操作表DML相关语句
【南瓜书ML】(task4)神经网络中的数学推导(更新ing)
pytest interface automation testing framework | single/multiple parameters
聊一聊ICMP协议以及ping的过程
关于App不同方式更新的测试点归纳
【ASWC Arxml结构分解】-7-Explicit(显式)和Implicit(隐式) Sender-Receiver communication描述差异
Go 支持 OOP: 用 struct 代替 class
I have three degrees, and I have five faces. I was "confessed" by the interviewer, and I got an offer of 33*15.
国内外最顶级的8大plm项目管理系统
R语言使用tidyquant包的tq_transmute函数计算持有某只股票的天、月、周收益率、ggplot2使用条形图可视化股票月收益率数据、使用百分比显示Y轴坐标数据、使用不同的色彩表征正负收益率
好的plm软件有哪些?plm软件排行榜
MVVM项目开发(商品管理系统一)
类似 MS Project 的项目管理工具有哪些
拳头游戏免版权音乐下载,英雄联盟无版权音乐,可用于视频创作、直播
HPC系统简介
牛客刷SQL---2