- 博客(6)
- 收藏
- 关注
原创 python pytest 介绍 插件介绍 fixture 装饰器 allure 报告 yaml 数据驱动
scope:表⽰被装饰器标记的⽅法的作⽤域(function默认,class,module,package,session) params:参数化(⽀持list[],tuple(),[(),()],([],[]))⾃动化测试包括⼀切通过⼯具(程序)的⽅式来代替或辅助⼿⼯测试的⾏为。其主要⼿段是模拟⼿⼯测试,通过组织编写⾃动化脚本执⾏测试⽤例,解决测试⼯作量⼤的问题,⾃动化测试能有效的提⾼测试效率。ps:我⽤的是mac系统,在写.py⽂件的路径时是这样写的,如果是win,注意⼀下⽂件路径即可。
2024-01-22 21:51:36
1621
原创 pytest三种运行方式
指定模块 pytest.main('[-vs],','./testcase/test_day1.py') 只运行testcase 下的test_day1.py 文件。#pytest.main(['–vs','./testcase/test_day2.py',‘reruns=2']) #失败得的用例重跑两次。#如 #pytest.main(['-vs','./testcase/test_day1.py','-n=2'])(2)指定模块 pytest -vs ./testcase/test_day1.py。
2024-01-22 14:12:10
1496
原创 python 基于PyEcharts生成饼图
set_global_opts(title_opts=opts.TitleOpts(title="Pie-基本示例")) .set_series_opts(label_opts=opts.LabelOpts(formatter="{b}: {c}"))当需要生成对应的图内容时,先查看.add中的数据类型,例如可以print(PyEcharts是百度开源可视化库,饼图。然后将自己的数据替换进去即可。
2024-01-10 09:52:29
546
1
原创 python假设接口返回内容为‘{“data“:[{“id“:111,“url“:“xxx“}]}‘,要从返回内容中提取值,可以使用Python的字典操作
import json# 假设这是接口返回的内容response_content = '{"data":[{"id":111,"url":"xxx"}]}'# 将返回内容转换为字典格式response_dict = json.loads(response_content)# 通过键值对访问字典中的值data_list = response_dict['data']first_item = data_list[0]id_value = first_item['id']url_value = fir
2024-01-09 15:54:17
394
原创 解决使用matplotlib.pyplot画图包含中文乱码显示问题(macbook上 family ‘sans-serif‘ not found 问题)
使用。
2024-01-09 15:51:51
529
空空如也
空空如也
TA创建的收藏夹 TA关注的收藏夹
TA关注的人