当前位置:网站首页>印象深刻的问题
印象深刻的问题
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边栏推荐
- Nemo of pulseaudio (22)
- Slow bear market, bit Store provides stable stacking products to help you cross the bull and bear
- Redis Series 2: data persistence improves availability
- New method of cross domain image measurement style relevance: paper interpretation and code practice
- MySQL中符号@的作用
- Hierarchical clustering and case analysis
- Handling of difficult and miscellaneous problems during the installation and configuration of qt5.5.1 desktop version (configuring arm compilation Kit)
- 鸿蒙发力!HDD杭州站·线下沙龙邀您共建生态
- 【Pygame小遊戲】這款“吃掉一切”遊戲簡直奇葩了?通通都吃掉嘛?(附源碼免費領)
- Basic configuration and usage of Jupiter notebook
猜你喜欢

Mobile terminal click penetration

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

Li Chuang EDA learning notes 16: array copy and array distribution

3.3 one of the fixed number of cycles

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

Event listening mechanism

Vulnerability recurrence ----- 34. Yapi remote command execution vulnerability

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

The two trump brand products of Langjiu are resonating in Chengdu, continuously driving the consumption wave of bottled liquor

Cesium realizes satellite orbit detour
随机推荐
米哈游起诉五矿信托,后者曾被曝产品暴雷
Redis Series 2: data persistence improves availability
3.2 multiple condition judgment
鸿蒙发力!HDD杭州站·线下沙龙邀您共建生态
特殊函数计算器
In the Alibaba cloud experiment, if the k8s forwards to port 3306 and the MySQL client is turned on, it will terminate abnormally. What is the reason?
logstash排除特定文件或文件夹不采集上报日志数据
是不是只要支持JDBC / ODBC协议的客户端恐惧,PolarDB-X可通过相关工具的客户端访问?
PolarDB-X现在版本的开源兼容什么?mysql8?
Mode setting of pulseaudio (21)
Use redis to automatically cancel orders within 30 minutes
C language set operation
3.3 one of the fixed number of cycles
数组表示若干个区间的集合,请你合并所有重叠的区间,并返回 一个不重叠的区间数组,该数组需恰好覆盖输入中的所有区间 。【LeetCodeHot100】
PolarDB-X开源版有没有支持 mysql5.7 的版本?
目前PolarDB-X是不支持数据库自制服务DAS么?
Construction and management practice of ByteDance buried point data flow
关于#mysql#的问题:问题遇到的现象和发生背景
[pyGame games] this "eat everything" game is really wonderful? Eat them all? (with source code for free)
Centos8 PostgreSQL initialization error: initdb: error: invalid locale settings; check LANG and LC_* environment