当前位置:网站首页>Pytest test framework notes
Pytest test framework notes
2022-06-25 15:41:00 【Test Xiaohang】
1. Use case identification mechanism
Automatically find in the running project directory test_ The beginning or _test Final document
The use case file is marked with test_ The first function will be treated as a test case
The use case file is marked with Test Initial class , Inside test_ Opening method , Will be used as a use case
2. Use case execution sequence
Use case file names begin with ascii Code to sort
Use cases in the use case file : Execute in the order of use case writing
3.pytest Before and after
@pytest.fixture
Parameters :scope: Specify the level before and after ( Use cases function, Test class class, modular module)
Parameters :autouse=True Automatically add pre and post to use cases
4.pytest Case marking
stay pytest.ini Register the mark in the file
Tag use cases :@pytest.mark. Tagnames
Execute through parameters -m To filter the marked use cases
5.pytest Use case parameterization
@pytest.mark.parametrize('item', cases)
边栏推荐
- Principle and implementation of MySQL master-slave replication (docker Implementation)
- Open the box to experience rust, come on!!!
- Do you want to go to an outsourcing company? This article will give you a comprehensive understanding of outsourcing pits!
- Kali SSH Remote Login
- 股票开户用什么app最安全?知道的给说一下吧
- Yolov5 Lite: fewer parameters, higher accuracy and faster detection speed
- 到底要不要去外包公司?这篇带你全面了解外包那些坑!
- [paper notes] rethinking and improving relative position encoding for vision transformer
- QT animation loading and closing window
- appium服务的启动与关闭踩坑记录
猜你喜欢

Record the time to read the file (the system cannot find the specified path)

Sword finger offer 03 Duplicate number in array

google_ Breakpad crash detection
Client development (electron) system level API usage 2

Download and installation tutorial of consumer

Completabilefuture of asynchronous tools for concurrent programming

Brief introduction to class loading process

Architecture evolution of high-performance servers -- Suggestions

Kali SSH Remote Login

Highly concurrent optimized Lua + openresty+redis +mysql (multi-level cache implementation) + current limit +canal synchronization solution
随机推荐
基于深度Q学习的雅达利打砖块游戏博弈
Statistical analysis - data level description of descriptive statistics
剑指 Offer 10- I. 斐波那契数列
golang reverse a slice
Do you want to go to an outsourcing company? This article will give you a comprehensive understanding of outsourcing pits!
免费送书啦!火遍全网的AI给老照片上色,这里有一份详细教程!
Programmer vs hacker thinking | daily anecdotes
0706-- replace fields in the use case, such as mobile phone number or ID
Summary of four parameter adjustment methods for machine learning
Markdown learning
Binocular 3D perception (I): preliminary understanding of binocular
Summary of regularization methods
Weka download and installation
[paper notes] semi supervised object detection (ssod)
Cloning and importing DOM nodes
Differences and solutions of redis cache avalanche, cache penetration and cache breakdown
剑指 Offer 09. 用两个栈实现队列
Go build reports an error missing go sum entry for module providing package ... to add:
Principle and implementation of MySQL master-slave replication (docker Implementation)
JS的注释