当前位置:网站首页>Getting started with pytest ----- confitest Application of PY
Getting started with pytest ----- confitest Application of PY
2022-07-02 04:42:00 【Peng Yuyan in the testing industry】
One 、fixture combination contest.py Files use
1、conftest.py
To hold fixture
Configuration file for . The name is fixed .
2、 stay conftest.py
All methods in the file do not need to import packages when calling
3、conftest.py
Files can have more than one , And multiple conftest.py
Multiple in the file fixture
Can be called by a use case .( That is, in different use cases package Can also be built in conftest.py File implementation call , Under the root directory, all use cases can be called )
New in the root directory conftest.py
file
And then we put fixture Cut the relevant code to conftest.py
In file
Cut the code in the red box to contest.py
in .
And then execute , Find that you can still get through . stay conftest.py
You can write more than one... In the file fixture Decorator method . When other files are called You don't need a guide bag You can call .
Two 、 Priority questions
fixture
Of session
The highest priority
fixture
Of class
Rank higher than setup_class
, That is to say, execute first fixture
Of scope="class"
Code
fixture
Of function
Rank higher than setup
, I.e. execute first fixture
Of scope="function"
Code
3、 ... and 、pytest Implementation process of
1、 Query the... Under the root directory conftest.py
file
2、 Query the... Under the root directory pytest.ini
file , Find the configuration of the test case
3、 Query the conftest.py
file
4、 Query whether there is... In the use case setup
、teardown
、setup_class
、teardown_class
5、 according to pytest.ini
Configure test case execution rules to execute test cases
The following is the supporting information , For doing 【 software test 】 For our friends, it should be the most comprehensive and complete war preparation warehouse , This warehouse also accompanied me through the most difficult journey , I hope it can help you !
Last : It can be in the official account : Programmer Xiaohao ! Get a free copy of 216 Page software testing engineer interview guide document information . And the corresponding video learning tutorial is free to share !, It includes basic knowledge 、Linux necessary 、Shell、 The principles of the Internet 、Mysql database 、 Special topic of bag capturing tools 、 Interface testing tool 、 Test advanced -Python Programming 、Web automated testing 、APP automated testing 、 Interface automation testing 、 Testing advanced continuous integration 、 Test architecture development test framework 、 Performance testing 、 Safety test, etc. .
If my blog helps you 、 If you like my blog content , please “ give the thumbs-up ” “ Comment on ” “ Collection ” One button, three links ! Friends who like software testing , You can join our testing technology exchange group :779450660 There are various software testing resources and technical discussions )
边栏推荐
- Design and implementation of general interface open platform - (44) log processing of API services
- Shutdown procedure after 60
- Pytoch --- use pytoch to realize u-net semantic segmentation
- 深圳打造全球“鸿蒙欧拉之城”将加快培育生态,优秀项目最高资助 1000 万元
- 记录一次Unity 2020.3.31f1的bug
- Research on the security of ognl and El expressions and memory horse
- Play with concurrency: draw a thread state transition diagram
- Major domestic quantitative trading platforms
- ThinkPHP kernel work order system source code commercial open source version multi user + multi customer service + SMS + email notification
- June book news | 9 new books are listed, with a strong lineup and eyes closed!
猜你喜欢
LM09丨费雪逆变换反转网格策略
Keil compilation code of CY7C68013A
Markdown编辑语法
Free drawing software recommended - draw io
The core idea of performance optimization, dry goods sharing
Cache consistency solution - how to ensure the consistency between the cache and the data in the database when changing data
cs架构下抓包的几种方法
Starting from the classification of database, I understand the map database
Yolov5 network modification tutorial (modify the backbone to efficientnet, mobilenet3, regnet, etc.)
Orthogonal test method and function diagram method for test case design
随机推荐
[understand one article] FD_ Use of set
I sorted out some basic questions about opencv AI kit.
Play with concurrency: what's the use of interruptedexception?
Mysql database learning
第十六周作业
Exposure X8 Standard Version picture post filter PS, LR and other software plug-ins
LeetCode-对链表进行插入排序
Design and implementation of general interface open platform - (44) log processing of API services
Is it safe to open an account with first venture securities? I like to open an account. How can I open it?
Beginner crawler - biqu Pavilion crawler
Tawang food industry insight | current situation, consumption data and trend analysis of domestic infant complementary food market
Realize the function of data uploading
C - derived classes and constructors
oracle 存储过程与job任务设置
C language practice - binary search (half search)
What are the rules and trading hours of agricultural futures contracts? How much is the handling fee deposit?
Yolov5网络修改教程(将backbone修改为EfficientNet、MobileNet3、RegNet等)
Solution of DM database unable to open graphical interface
Federal learning: dividing non IID samples according to Dirichlet distribution
Gin framework learning code