当前位置:网站首页>印象深刻的问题
印象深刻的问题
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边栏推荐
- 阿里云刘珅孜:云游戏带来的启发——端上创新
- Solving Poisson equation by tensorflow
- 泰山OFFICE技术讲座:第一难点是竖向定位
- Introduce you to ldbc SNB, a powerful tool for database performance and scenario testing
- ORM表关系及操作
- C語言教師工作量管理系統
- Li Chuang EDA learning notes 16: array copy and array distribution
- SQL parsing practice of Pisa proxy
- 开源二三事|ShardingSphere 与 Database Mesh 之间不得不说的那些事
- 防火墙基础之源NAT地址转换和服务器映射web页面配置
猜你喜欢

The interview lasted for half a year. Last month, I successfully got Alibaba p7offer. It was all because I chewed the latest interview questions in 2020!

Hierarchical clustering and case analysis

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

Raspberry pie preliminary use

LeetCode每日一练(两数之和)

防火墙基础之源NAT地址转换和服务器映射web页面配置

EMQ 助力青岛研博建设智慧水务平台

Introduce you to ldbc SNB, a powerful tool for database performance and scenario testing
P.A.R.A 方法在思源的简易应用(亲测好用)

鴻蒙發力!HDD杭州站·線下沙龍邀您共建生態
随机推荐
#yyds干货盘点#简述chromeV8引擎垃圾回收
Sigkdd22 | graph generalization framework of graph neural network under the paradigm of "pre training, prompting and fine tuning"
数组表示若干个区间的集合,请你合并所有重叠的区间,并返回 一个不重叠的区间数组,该数组需恰好覆盖输入中的所有区间 。【LeetCodeHot100】
Four characteristics of transactions
实现简单的三D立方体自动旋转
字节跳动埋点数据流建设与治理实践
Special function calculator
国家食品安全风险评估中心:不要盲目片面追捧标签为“零添加”“纯天然”食品
基于 Nebula Graph 构建百亿关系知识图谱实践
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
Expert: those who let you go to a good school with a low score are all Scams
EMQ 助力青岛研博建设智慧水务平台
Does polardb-x open source support mysql5.7?
3.1 simple condition judgment
The role of the symbol @ in MySQL
鴻蒙發力!HDD杭州站·線下沙龍邀您共建生態
Can polardb-x be accessed through the client of related tools as long as the client supporting JDBC / ODBC protocol is afraid?
P.A.R.A 方法在思源的简易应用(亲测好用)
分布式Session解决方案
【Pygame小游戏】这款“吃掉一切”游戏简直奇葩了?通通都吃掉嘛?(附源码免费领)