当前位置:网站首页>印象深刻的问题
印象深刻的问题
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边栏推荐
- Yyds dry inventory solution sword finger offer: a path with a certain value in the binary tree (3)
- After the mobile phone, it was reported that Samsung also cut the output of TV and other home appliance product lines
- Smart wind power | Tupu software digital twin wind turbine equipment, 3D visual intelligent operation and maintenance
- 请问阿里云实验中 k8s 对于3306端口转发,同时开启mysql客户端就会异常终止,是什么原因呢?
- 事件监听机制
- 目前PolarDB-X是不支持数据库自制服务DAS么?
- MySQL中符号@的作用
- # Cesium实现卫星在轨绕行
- Bit.Store:熊市漫漫,稳定Staking产品或成主旋律
- logstash排除特定文件或文件夹不采集上报日志数据
猜你喜欢

继手机之后 报道称三星也削减了电视等家电产品线的产量

Distributed session solution

带你认识图数据库性能和场景测试利器LDBC SNB

Construction and management practice of ByteDance buried point data flow

Redis系列2:数据持久化提高可用性

Hierarchical clustering and case analysis

Hongmeng makes efforts! HDD Hangzhou station · offline salon invites you to build ecology

Domain name binding dynamic IP best practices

分布式Session解决方案

3.2 multiple condition judgment
随机推荐
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!
C语言集合运算
Alibaba cloud liupeizi: Inspiration from cloud games - innovation on the end
About MySQL: the phenomenon and background of the problem
3.4 fixed number of cycles II
Etcd可视化工具:Kstone部署(一),基于Helm快速部署
Open source 23 things shardingsphere and database mesh have to say
Julia constructs diagonal matrix
10分钟掌握mysql的安装步骤
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
基于 Nebula Graph 构建百亿关系知识图谱实践
Pragma once Usage Summary
Slow bear market, bit Store provides stable stacking products to help you cross the bull and bear
Regular matching starts with what, ends with what, starts with what, and ends with what
华为云DevCloud重磅发布四大新能力,创下国内两项第一
正则匹配以什么开头、以什么结尾,以非什么开头,以非什么结尾
NFT dual currency pledge liquidity mining DAPP contract customization
目前PolarDB-X是不支持数据库自制服务DAS么?
What is RPC
A robot is located in the upper left corner of an M x n grid. The robot can only move down or right one step at a time. The robot attempts to reach the lower right corner of the grid. How many differe