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版本顺便解决参数化,控制台输出参数化值有中文时显示问题

解决后

相关推荐
not coder3 天前
Pytest 是什么
数据库·pytest
程序猿阿伟6 天前
《深入剖析:Python自动化测试框架之unittest与pytest》
开发语言·python·pytest
水银嘻嘻6 天前
07 接口自动化-用例管理框架之pytest单元测试框架
单元测试·自动化·pytest
水银嘻嘻7 天前
09 接口自动化-用例管理框架pytest之allure报告定制以及数据驱动
自动化·pytest
程序员三藏8 天前
接口自动化测试框架(pytest+allure+aiohttp+ 用例自动生成)
自动化测试·软件测试·python·职场和发展·测试用例·pytest·接口测试
水银嘻嘻9 天前
08 接口自动化-用例管理框架pytest之fixtrue,conftest.py,allure报告以及logo定制
python·自动化·pytest
A_Tai233333310 天前
PyTest
pytest
bjwuzh16 天前
使用pytest实现参数化后,控制台输出的日志是乱码
pytest
2025年一定要上岸17 天前
pytest框架 - 第二集 allure报告
pytest
头疼的程序员18 天前
allure生成测试报告(搭配Pytest、allure-pytest)
测试工具·pytest