pytest + yaml 框架 -58.运行报告总结summary.json

前言

用例运行结束后,在本地生成summary.json 文件,总结运行结果。

v1.5.1版本更新内容:

1.解决参数化,中文在控制台输出问题

2.保存用例结果summary.json

保存用例结果summary.json

命令行执行用例

复制代码
pytest

运行结束,在当前目录生成summary.json 文件,内容如下

json 复制代码
{
    "base_url": "http://127.0.0.1:8201",
    "time": {
        "start": "2023-11-08 23:20:45",
        "stop": "2023-11-08 23:20:45",
        "duration": "0.51s"
    },
    "statistic": {
        "failed": 0,
        "broken": 0,
        "skipped": 0,
        "passed": 23,
        "total": 23,
        "successful": "100.00%"
    }
}

方便后续集成到jenkins 等其它CI/CD平台上,发送报告通知时读取报告结果内容。

参数化控制台输出中文问题

v1.5.1版本顺便解决参数化,控制台输出参数化值有中文时显示问题

解决后

相关推荐
鹿鸣悠悠14 小时前
pytest + requests + allure 接口自动化测试框架指南
pytest
忘忧记15 小时前
pytest进阶参数化用法
前端·python·pytest
bug_rabbit16 小时前
pytest-html 中文乱码问题终极解决方案(Windows版)
windows·html·pytest
庄小法16 小时前
pytest
开发语言·python·pytest
工具人55552 天前
pytest练习
pytest
好家伙VCC2 天前
# Pytest发散创新:从基础测试到智能断言的实战进阶指南在现代软
java·python·pytest
小罗和阿泽3 天前
GUI 自动化测试 pywinauto测试框架
开发语言·python·功能测试·测试工具·pytest
文人sec3 天前
抛弃 Postman!用 Pytest+Requests+Allure+Playwright+Minium 搭建高逼格接口+UI自动化测试平台
自动化测试·python·测试工具·ui·pytest·playwright
曲幽3 天前
FastAPI单元测试实战:别等上线被喷才后悔,TestClient用对了真香!
python·单元测试·pytest·api·fastapi·web·httpx·testclient·依赖项覆盖
小罗和阿泽4 天前
接口测试系列 接口自动化测试 pytest框架(四)
pytest