当前位置:网站首页>印象深刻的问题
印象深刻的问题
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边栏推荐
- [Niuke's questions] nowcoder claims to have remembered all Fibonacci numbers between 1 and 100000. To test him, we gave him a random number N and asked him to say the nth Fibonacci number. If the nth
- What should the ultimate LAN transmission experience be like
- Smart wind power | Tupu software digital twin wind turbine equipment, 3D visual intelligent operation and maintenance
- The two trump brand products of Langjiu are resonating in Chengdu, continuously driving the consumption wave of bottled liquor
- LeetCode每日一练(无重复字符的最长子串)
- Alibaba cloud liupeizi: Inspiration from cloud games - innovation on the end
- P. Simple application of a.r.a method in Siyuan (friendly testing)
- 如果想用dms来处理数据库权限问题,想问下账号只能用阿里云的ram账号吗(阿里云的rds)
- 面试半年,上个月成功拿到阿里P7offer,全靠我啃烂了这份2020最新面试题!
- [pyGame games] this "eat everything" game is really wonderful? Eat them all? (with source code for free)
猜你喜欢

List转Table

一场分销裂变活动,不止是发发朋友圈这么简单!

express

开源二三事|ShardingSphere 与 Database Mesh 之间不得不说的那些事

Raspberry pie preliminary use

Sigkdd22 | graph generalization framework of graph neural network under the paradigm of "pre training, prompting and fine tuning"

Google Earth Engine(GEE)——Export. image. The difference and mixing of toasset/todrive, correctly export classification sample data to asset assets and references

2022年中国音频市场年度综合分析

一个机器人位于一个 m x n 网格的左上角 。机器人每次只能向下或者向右移动一步。机器人试图达到网格的右下角。问总共有多少条不同的路径?【LeetCodeHot100】

IDE Eval reset unlimited trial reset
随机推荐
Scrapy framework (I): basic use
Hierarchical clustering and case analysis
开源二三事|ShardingSphere 与 Database Mesh 之间不得不说的那些事
Nemo of pulseaudio (22)
是不是只要支持JDBC / ODBC协议的客户端恐惧,PolarDB-X可通过相关工具的客户端访问?
2022年中国音频市场年度综合分析
华为云首次解读云原生2.0十大典型架构,加速构建现代化应用
New method of cross domain image measurement style relevance: paper interpretation and code practice
Hung - Mung! HDD Hangzhou station · salon hors ligne vous invite à construire l'écologie
16 -- remove invalid parentheses
[Niuke's questions] nowcoder claims to have remembered all Fibonacci numbers between 1 and 100000. To test him, we gave him a random number N and asked him to say the nth Fibonacci number. If the nth
【Pygame小游戏】这款“吃掉一切”游戏简直奇葩了?通通都吃掉嘛?(附源码免费领)
Qt5 signal and slot mechanism (basic introduction to signal and slot)
国家食品安全风险评估中心:不要盲目片面追捧标签为“零添加”“纯天然”食品
【Pygame小遊戲】這款“吃掉一切”遊戲簡直奇葩了?通通都吃掉嘛?(附源碼免費領)
Leetcode daily practice (main elements)
3.1 simple condition judgment
After the mobile phone, it was reported that Samsung also cut the output of TV and other home appliance product lines
防火墙基础之源NAT地址转换和服务器映射web页面配置
Does polardb-x open source support mysql5.7?