当前位置:网站首页>Pytest interface automation test framework | use decorators to decorate the use cases that need to be run
Pytest interface automation test framework | use decorators to decorate the use cases that need to be run
2022-07-26 11:57:00 【COCOgsta】
Video source :B standing 《 Risking your life to upload !pytest Interface automation test framework ( From basic theory to project practice and secondary development ) Teaching video 【 software test 】》
Organize the teacher's course content and test notes while studying , And share it with you , Infringement is deleted , Thank you for your support !
Attach summary sticker :pytest Interface automation test framework | Summary _COCOgsta The blog of -CSDN Blog
You can make use cases reference specified fixture
import pytest
# fixture Marked functions can be specified using decorators
@pytest.fixture()
def fix1():
print('\n introduce fixt1, Start execution Function')
@pytest.fixture()
def fix2():
print("\n introduce fix2, Start execution Function")
@pytest.mark.usefixtures('fix1')
def test_1():
print('------ Use cases 1 perform ---------')
# 1. It needs to be marked in the front fix1、fix2 function , Only here can we use
# 2. Marked on the front fix2 function , If not quoted , It will not be executed after execution fix2 function
@pytest.mark.usefixtures('fix1')
class Test_Case:
def test_2(self):
print('--------- Use cases 2 perform -----------')
def test_3(self):
print('--------- Use cases 3 perform ---------')
if __name__ == '__main__':
pytest.main(['-s', 'test_usefixtures.py'])边栏推荐
- pytest接口自动化测试框架 | pytest的setup和teardown函数
- 以太网驱动详解之RMII、SMII、GMII、RGMII接口
- Practice of microservice in solving Library Download business problems
- 7月27日19:30直播预告:HarmonyOS3及华为全场景新品发布会
- What is per title encoding?
- pytest接口自动化测试框架 | pytest获取执行数据、pytest禁用插件
- Pyechart offline deployment
- 【安徽大学】考研初试复试资料分享
- Harbor2.2 quick check of user role permissions
- 滴滴被罚80亿!拿用户数据赚钱的时代结束了
猜你喜欢

Understand the string class

Practice of microservice in solving Library Download business problems

PyCharm是真的强

【附下载】一款强大的Web自动化漏洞扫描工具——Xray

忆凤姐

Swagger2.9.2 tutorial and swagger3.0.0 tutorial

Flink 在 讯飞 AI 营销业务的实时数据分析实践

一些实用、常用、效率越来越高的 Kubernetes 别名

程序员培训学习后好找工作吗?

Hou Peixin, chairman of the openharmony Working Committee of the open atom open source foundation, sent a message to the openatom openharmony sub forum
随机推荐
忆凤姐
音视频技术开发周刊 | 255
网络协议:TCP/IP协议
4.1 configure MySQL and register login module
【附下载】一款强大的Web自动化漏洞扫描工具——Xray
[ten thousand words long text] Based on LSM tree thought Net 6.0 C # realize kV database (case version)
元宇宙日报|元宇宙社交 App“派对岛”产品下架;广州南沙元宇宙产业集聚区揭牌;数字经济发展部际联席会议制度推出
【通信原理】第三章 -- 随机过程[上]
Flink cdc 是不是只支持 sql-client的方式提交SQL脚本啊
系统调用捕获和分析完结篇制作系统调用日志收集系统
10 reduce common "tricks"
pytest接口自动化测试框架 | 重新运行失败用例
Question and answer No. 48: geek appointment - construction path of observable system
建模杂谈系列150 SCLC工程化实验3-SRule
零基础小白也能懂的 Redis 数据库,手把手教你易学易用!
.....
Application scheme of ankerui residual pressure monitoring system in residential quarter
Redis database, which can be understood by zero foundation Xiaobai, is easy to learn and use!
【安徽大学】考研初试复试资料分享
Esp8266 Arduino programming example - development environment construction (based on platformio)