当前位置:网站首页>Pytest interface automated testing framework | using multiple fixtures
Pytest interface automated testing framework | using multiple fixtures
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
- If the use case requires multiple fixture Data returned by ,fixture Can return an element ,list Or a dictionary , Then take the corresponding data from it
import pytest
@pytest.fixture()
def test1():
a = 'zz'
b = '123456'
print(' Efferent a,b')
return(a,b)
def test2(test1):
u = test1[0]
p = test1[1]
assert u == 'zz'
assert p == '123456'
print(' adopt fixture Get the user name and password correctly ')
if __name__ == '__main__':
pytest.main(['-s', 'test_multi_fixtures01.py'])- It can be divided into several fixture, Then pass multiple... In the use case fixture Parameters
import pytest
@pytest.fixture()
def test1():
a = 'zz'
print("\n Efferent a")
return a
@pytest.fixture()
def test2():
b = '123456'
print(' Efferent b')
return b
def test_3(test1, test2):
u = test1
p = test2
assert u == 'zz'
assert p == '123456'
print(" Introduce more than one fixture The parameters are correct ")
if __name__ == '__main__':
pytest.main(['-s', 'test_multi_fixtures02.py'])边栏推荐
- 【万字长文】使用 LSM-Tree 思想基于.Net 6.0 C# 实现 KV 数据库(案例版)
- Several inventory terms often used in communication
- Yuancosmos daily | yuancosmos social app "Party Island" product off the shelves; Guangzhou Nansha yuanuniverse industrial agglomeration zone was unveiled; The inter ministerial joint conference system
- Miccai2022 paper | evolutionary multi-objective architecture search framework: application in covid-19 3D CT classification
- pytest接口自动化测试框架 | 重新运行失败用例
- Hashtable
- 向日葵远程控制为何采用BGP服务器?自动最优路线、跨运营商高速传输
- Data Lake (19): SQL API reads Kafka data and writes it to iceberg table in real time
- Live broadcast preview at 19:30 on July 27: harmonyos3 and Huawei's full scene new product launch
- Recalling Sister Feng
猜你喜欢

PyCharm是真的强

4.1 配置Mysql与注册登录模块

An online duplicate of a hidden bug

Leetcode / Scala - sum of two numbers, three numbers, four numbers, and N numbers

V00 - 年纪大了,想做啥就做啥吧

音视频技术开发周刊 | 255
![[download attached] a powerful web automated vulnerability scanning tool - Xray](/img/5e/1db72ce9bf758b1e68e8d6d2026302.png)
[download attached] a powerful web automated vulnerability scanning tool - Xray

音视频+

Wechat applet - Advanced chapter Lin UI component library source code analysis button component (I)

【附下载】一款强大的Web自动化漏洞扫描工具——Xray
随机推荐
.....
7月27日19:30直播预告:HarmonyOS3及华为全场景新品发布会
pytest接口自动化测试框架 | pytest配置文件
系统调用捕获和分—Ring3层LD_PRELOAD机制进行库函数劫持
Live broadcast preview at 19:30 on July 27: harmonyos3 and Huawei's full scene new product launch
pytest接口自动化测试框架 | 使用装饰器修饰需要运行的用例
Colt DCS is serious about building a green data center!
C language code quantity statistical tool
最新心形拼图小程序源码+带流量主
浅谈Web Vitals
浅谈低代码技术在物流运输平台中的搭建与管理
Didi was fined 8billion! The era of making money from user data is over
开放原子开源基金会OpenHarmony工作委员会主席侯培新寄语OpenAtom OpenHarmony分论坛
Flink 在 讯飞 AI 营销业务的实时数据分析实践
Pyechart offline deployment
Wechat applet - Advanced chapter Lin UI component library source code analysis button component (I)
pytest接口自动化测试框架 | pytest常用插件
V00 - 年纪大了,想做啥就做啥吧
剑指 Offer 24. 反转链表
Koin