当前位置:网站首页>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)
边栏推荐
- Several solutions to the distributed lock problem in partial Internet companies
- Solve the go project compilation error go mod: no such file or directory
- Several common optimization methods
- 基于深度Q学习的雅达利打砖块游戏博弈
- Distributed token
- The last glory of the late Ming Dynasty - the battle of Korea
- Arthas source code learning-1
- Learning to Measure Changes: Fully Convolutional Siamese Metric Networks for Scene Change Detection
- Simulating Sir disease transmission model with netlogo
- Brief object memory layout
猜你喜欢

剑指 Offer 05. 替换空格

Could not connect to redis at 127.0.0.1:6379 in Windows

Data feature analysis skills - correlation test

golang使用mongo-driver操作——增(进阶)

Differences and solutions of redis cache avalanche, cache penetration and cache breakdown

Distributed transaction solution

基于深度Q学习的雅达利打砖块游戏博弈

Summary of regularization methods

Sword finger offer II 091 Paint the house

Programmer vs hacker thinking | daily anecdotes
随机推荐
MySQL修改字段語句
If a thread overflows heap memory or stack memory, will other threads continue to work
剑指 Offer 06. 从尾到头打印链表
VectorDraw Developer Framework 10.1001 Crack
Completabilefuture of asynchronous tools for concurrent programming
通俗讲跨域
Highly concurrent optimized Lua + openresty+redis +mysql (multi-level cache implementation) + current limit +canal synchronization solution
剑指 Offer 09. 用两个栈实现队列
Is it safe to open a stock account through the account opening link given by the account manager? I want to open an account
Websocket (WS) cluster solution
How GC determines whether an object can be recycled
Is Guoxin golden sun reliable? Is it legal? Is it safe to open a stock account?
The last glory of the late Ming Dynasty - the battle of Korea
Pytorch | how to save and load pytorch models?
[paper notes] rethinking and improving relative position encoding for vision transformer
Why do I need message idempotence?
Solve the go project compilation error go mod: no such file or directory
Download and installation tutorial of consumer
MySQL modify field statement
JSON module dictionary and string conversion