当前位置:网站首页>印象深刻的问题
印象深刻的问题
2022-06-27 15:45:00 【诺一呦~】
1.pytest excel数据驱动生成测试用例,一个表格中有多个sheet(一个sheet为一个test_suite),使用yield源源不断的生成Test类,同时测试用例里面得到的测试类对象要不同(相同的话会覆盖上一个对象),,自动loadexcel表格,多个excel文件使用循环即可
def create_case(test_suite: dict):
"""
接收从excel传来的多个测试套件的信息,并生成真正的测试用例
:param test_suite:
:return:
"""
for suite_name,case_dict in test_suite.items():
class Test:
@pytest.mark.parametrize("case",case_dict.items())
def test_(self,case):
name = case[0]
step_list = case[1]
print(f"{name=}")
print(f"{step_list=}")
yield Testtest_dir = Path(__file__).parent
file_list = list(test_dir.glob("test_*.xlsx"))
_case_count = 0
for file in file_list:
data = data_by_excel(file)
for case in create_case(data):
_case_count += 1
globals()[f"Test{_case_count}"] = case边栏推荐
- 如果想用dms来处理数据库权限问题,想问下账号只能用阿里云的ram账号吗(阿里云的rds)
- EMQ 助力青岛研博建设智慧水务平台
- Leetcode daily practice (longest substring without repeated characters)
- What is the level 3 password complexity of ISO? How often is it replaced?
- Leetcode daily practice (Yanghui triangle)
- 【Pygame小遊戲】這款“吃掉一切”遊戲簡直奇葩了?通通都吃掉嘛?(附源碼免費領)
- C语言集合运算
- QT audio playback upgrade (7)
- C語言教師工作量管理系統
- What should the ultimate LAN transmission experience be like
猜你喜欢
The role of the symbol @ in MySQL

About MySQL: the phenomenon and background of the problem

字节跳动埋点数据流建设与治理实践

What is the level 3 password complexity of ISO? How often is it replaced?

Centos8 PostgreSQL initialization error: initdb: error: invalid locale settings; check LANG and LC_* environment

基于 Nebula Graph 构建百亿关系知识图谱实践

Slow bear market, bit Store provides stable stacking products to help you cross the bull and bear

#yyds干货盘点# 解决剑指offer:二叉树中和为某一值的路径(三)

Bit. Store: long bear market, stable stacking products may become the main theme

ICML 2022 ぷ the latest fedformer of the Dharma Institute of Afghanistan ⻓ surpasses SOTA in the whole process of time series prediction
随机推荐
Bit.Store:熊市漫漫,稳定Staking产品或成主旋律
A distribution fission activity is more than just a circle of friends!
QT5 之信号与槽机制(演示控件自带的信号与槽函数关联)
目前PolarDB-X是不支持数据库自制服务DAS么?
开源二三事|ShardingSphere 与 Database Mesh 之间不得不说的那些事
数组表示若干个区间的集合,请你合并所有重叠的区间,并返回 一个不重叠的区间数组,该数组需恰好覆盖输入中的所有区间 。【LeetCodeHot100】
Slow bear market, bit Store provides stable stacking products to help you cross the bull and bear
面试半年,上个月成功拿到阿里P7offer,全靠我啃烂了这份2020最新面试题!
防火墙基础之源NAT地址转换和服务器映射web页面配置
Smart wind power | Tupu software digital twin wind turbine equipment, 3D visual intelligent operation and maintenance
Handling of difficult and miscellaneous problems during the installation and configuration of qt5.5.1 desktop version (configuring arm compilation Kit)
Array represents a collection of several intervals. Please merge all overlapping intervals and return a non overlapping interval array. The array must exactly cover all the intervals in the input. 【Le
Weekly snapshot of substrate technology 20220411
是不是只要支持JDBC / ODBC协议的客户端恐惧,PolarDB-X可通过相关工具的客户端访问?
C système de gestion de la charge de travail des enseignants en langues
PolarDB-X开源版有没有支持 mysql5.7 的版本?
What are the password requirements for waiting insurance 2.0? What are the legal bases?
Taishan Office Technology Lecture: the first difficulty is vertical positioning
What is the open source compatibility of the current version of polardb-x? mysql8?
深耕数字化,引领云原生,服务更多开发者