当前位置:网站首页>Impressive questions
Impressive questions
2022-06-27 16:37:00 【Nuoyiyou ~】
1.pytest excel Data driven test case generation , There are multiple in a table sheet( One sheet For one test_suite), Use yield Continuous generation Test class , At the same time, the test class objects obtained in the test cases should be different ( The same will overwrite the previous object ),, Automatically loadexcel form , Multiple excel The file can be used circularly
def create_case(test_suite: dict):
"""
Receive from excel Information from multiple test suites , And generate real test cases
: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边栏推荐
- Sigkdd22 | graph generalization framework of graph neural network under the paradigm of "pre training, prompting and fine tuning"
- 利用Redis实现订单30分钟自动取消
- # Cesium实现卫星在轨绕行
- Hung - Mung! HDD Hangzhou station · salon hors ligne vous invite à construire l'écologie
- Cesium realizes satellite orbit detour
- Qt5 signal and slot mechanism (basic introduction to signal and slot)
- What are the password requirements for waiting insurance 2.0? What are the legal bases?
- The time of localdatetime type (2019-11-19t15:16:17) is queried with the time range of Oracle
- 树莓派初步使用
- [pyGame games] this "eat everything" game is really wonderful? Eat them all? (with source code for free)
猜你喜欢

# Cesium实现卫星在轨绕行

Mihayou sued Minmetals trust, which was exposed to product thunderstorms

带你认识图数据库性能和场景测试利器LDBC SNB
![[pygame Games] ce jeu](/img/3c/e573106ec91441a554cba18d5b2253.png)
[pygame Games] ce jeu "eat Everything" est fantastique? Tu manges tout? (avec code source gratuit)

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

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

Introduce you to ldbc SNB, a powerful tool for database performance and scenario testing

分布式Session解决方案

Annual comprehensive analysis of China's audio market in 2022

What should the ultimate LAN transmission experience be like
随机推荐
About how vs2019c # establishes the login interface, the user name and password entered must match the records in the access database
IDE Eval reset unlimited trial reset
Relation and operation of ORM table
Nemo of pulseaudio (22)
Sigkdd22 | graph generalization framework of graph neural network under the paradigm of "pre training, prompting and fine tuning"
Julia constructs diagonal matrix
事务的四大特性
Huawei cloud devcloud launched four new capabilities, setting two domestic firsts
Etcd visualization tool: kstone deployment (I), rapid deployment based on Helm
米哈游起诉五矿信托,后者曾被曝产品暴雷
【多线程】线程通信调度、等待集 wait() 、notify()
面试半年,上个月成功拿到阿里P7offer,全靠我啃烂了这份2020最新面试题!
National food safety risk assessment center: do not blindly and unilaterally pursue "zero addition" and "pure natural" food
QT5.5.1桌面版安装配置过程中的疑难杂症处理(配置ARM编译套件)
EMQ 助力青岛研博建设智慧水务平台
Introduce you to ldbc SNB, a powerful tool for database performance and scenario testing
localDateTime类型的时间(2019-11-19T15:16:17) 用oracle的时间范围查询
Leetcode daily practice (Yanghui triangle)
Hongmeng makes efforts! HDD Hangzhou station · offline salon invites you to build ecology
智慧风电 | 图扑软件数字孪生风机设备,3D 可视化智能运维