展示HN:一个零配置的 Pytest HTML 报告插件(单文件,适合持续集成)
嗨,HN
我开发了一个名为 pytest-reporter-plus 的小型 Pytest 插件,它可以在不影响您现有设置的情况下提供更好的测试报告。如果您使用 Pytest,这个报告就能直接使用。
为什么我会开发它:
大多数 pytest 测试报告工具要么:
- 需要用 @allure.* 这样的装饰器为每个测试打标签
- 生成臃肿的仪表板和充满资产(图表、JS、CSS)的文件夹
- 需要配置/设置才能查看基本结果
- 或者单页报告缺乏基本功能,比如搜索
我只是想要一个:
- 单页 HTML
- 无需配置,无依赖,无需归档的文件夹
- 清晰可见的通过/失败/跳过/不稳定测试状态
- 可追溯性:链接、标记、测试路径
- 可选的邮件报告功能
- 在 CI 和本地环境中开箱即用
它的功能:
- 合并 JSON 报告(支持并行运行)
- 突出显示不稳定测试的重试
- 清晰显示标准输出/标准错误/日志
- 强大的过滤器(状态、标记、时间、未跟踪等)
- 可复制粘贴的测试路径
- 没有仪表板。只有一个可以直接放入聊天/邮件的 HTML 文件。
还有更多功能……
如果您尝试了这个插件,请告诉我——我很乐意根据您的反馈进行改进。如果您觉得它有用,在 GitHub 上给我一个星星将会非常重要: [https://github.com/reach2jeyan/pytest-reporter-plus](https://github.com/reach2jeyan/pytest-reporter-plus)
查看原文
Hi HN<p>I built a small Pytest plugin called pytest-reporter-plus that gives you better test reporting without touching your existing setup. If you use Pytest, this report just works.<p>Why I built it:
Most pytest test reporting tools either:<p>Require tagging every test with decorators like @allure.*<p>Generate bloated dashboards and folders full of assets (charts, JS, CSS)<p>Need config/setup just to view basic results<p>or single page report just lacks the basic features like even search<p>I just wanted a:
A single-page HTML
No config, no dependencies, no folders to archive
Good visibility into pass/fail/skipped/flaky
Traceability: links, markers, test paths
Optionally email the report
Works in CI and local, right out of the box<p>What it does:
Merges JSON reports (supports parallel runs)<p>Highlights flaky test retries<p>Shows stdout / stderr / logs clearly<p>Powerful filters (status, marker, time, untracked, etc.)<p>Copy-pasteable test paths<p>No dashboards. Just one HTML file you can drop in chat/email.<p>AND MANY MORE...<p>Let me know if you try it — happy to improve it with your feedback.
If you find it useful, a star on GitHub would mean a lot: <a href="https://github.com/reach2jeyan/pytest-reporter-plus">https://github.com/reach2jeyan/pytest-reporter-plus</a>