pytest
Old-Bear
这个作者很懒,什么都没留下…
展开
专栏收录文章
- 默认排序
- 最新发布
- 最早发布
- 最多阅读
- 最少阅读
-
Linux pytest +allure 运行遇到的坑
1.Python3 run.py 无法运行pytest框架服务器安装:pip install pytest。我也能用Python导入库解决方法:python -m pytestpython3 -m pytest --html=%s/report.html --self-contained-html --alluredir %s 2.allure运行报错 “ValueError: option names {'--alluredir'} already added”问...原创 2021-01-19 16:24:04 · 1903 阅读 · 3 评论 -
pytest-html 报告与IDE控制台输出中文编码冲突问题
在使用pytest-html插件时,有时我们的测试用例名称或者参数是中文时,在测试报告中显示的内容会出现编码异常。出现这个问题的原因是pytest-html默认对节点ID进行了utf-8和unicode编码转化,而我们在控制台输出的时候 需要增加 转码操作,那么久问题来了,出现重复转码,所以显示出现所谓的乱码。解决方法也很简单,只需要把源码中的 转码过程禁用掉即可。代码位置:python环境\venv\Lib\site-packages\pytest_html\plugin.pyse...原创 2020-12-28 09:06:54 · 909 阅读 · 0 评论 -
Python 万金油 json 字符串 dict list 解析
Python 万金油 json 字符串解析:defjsonDt(contents):ifisinstance(contents,list):forxinrange(len(contents)):print('当前字段类型={%s}'%type(contents[x]))ifisinstance(contents[x],dict):print('列表嵌套字典Kay={...原创 2020-12-23 13:19:07 · 315 阅读 · 0 评论 -
API_Automation 基于Pytest+request+Allure的接口自动化开源框架
API_Automation基于Pytest+request+Allure的接口自动化开源框架Common 公共包公共包模块类设计Request.py 封装request方法,可以支持多协议扩展(get\post\put)Config.py读取配置文件,包括:不同环境的配置,email相关配置Log.py 封装记录log方法,分为:debug、info、warning、error、criticalEmail.py封装smtplib方法,运行结果发送邮件通知Assert.py 封装ass原创 2020-12-21 13:38:04 · 848 阅读 · 2 评论
分享