pytest
Dannywxd
做自己
展开
-
JSON to YAML
JSON: YAML: https://www.json2yaml.com/翻译 2022-12-07 17:55:12 · 328 阅读 · 0 评论 -
pytest.ini 文件加注解报错,UnicodeDecodeError: ‘gbk‘ codec can‘t decode byte 0xaf 解决方案
3.运行错误:UnicodeDecodeError: 'gbk' codec can't decode byte 0xaf。1)选中pytest.ini,点击选中File->File Properties->File Encoding。1.问题现象:pytest.ini 文件中,在[pytest] 换行加注解,运行正常的脚本时报错。3)重新执行正常脚本,不再报错。原创 2022-10-26 16:59:47 · 409 阅读 · 0 评论 -
pytest+allure
2.4.2 清空上次报告记录:>pytest --alluredir ./report/allure_raw --clean-alluredir。2.3.指定报告路径,生成报告原始文件:>pytest --alluredir ./report/allure_raw。3.Suites:测试套件,即所有用例的层级关系,可以按package/module/class/method进行查找。7.Packages:用例按Package进行分组,根据测试结果按不同的Package进行分组,并以树形结构进行展示。原创 2022-06-24 17:41:20 · 1942 阅读 · 0 评论 -
报错:UnicodeDecodeError: ‘gbk‘ codec can‘t decode byte 0xb1 in position 5: illegal multibyte sequence
问题:pytest 上传文件接口 报错:UnicodeDecodeError: 'gbk' codec can't decode byte 0xb1 in position 5: illegal multibyte sequence起初不了解,初步定为解码问题,改为了: open("D:/00pythonProject_wxd/import_default_price.xls",encoding="utf-8") 仍然报错:解决方案: open("D:/0原创 2022-06-16 11:15:17 · 862 阅读 · 0 评论 -
pytest 上传文件接口 报错:AttributeError: ‘int‘ object has no attribute ‘encode‘
pytest 上传文件接口 报错:AttributeError: 'int' object has no attribute 'encode' 原因:encode方法需要传值字符串string 解决方案:原创 2022-06-15 17:11:01 · 464 阅读 · 0 评论