【发布时间】:2021-11-26 11:55:00
【问题描述】:
基本上我有一个场景,我需要分别运行一组并行 pytest 和另一组串行 pytest。 每个都会生成单独的 pytest-html 报告。 但我正在寻找结合生成的报告的解决方案。 例如: py.test -n auto -m "非串行" --dist=loadfile --html=report1.html py.test -n auto -m "serial" --dist=loadfile --html=report2.html
有没有办法结合report1.html和report2.html生成单个html报告?
【问题讨论】:
-
不,没有 HTML 报告的组合。你必须自己实现。
-
正如@hoefling 所说,这是不可能的,GitHub 上有一个错误报告跟踪它。 github.com/pytest-dev/pytest-html/issues/183 虽然人们使用了一种解决方法: * 使用 pytest 的 junit 功能编写 junit/xunit/xunit2 报告。 * 将单元报告与 junitparser 结合起来。 * 使用 junit2html 生成 HTML 报告。
-
有一个新的实用程序可以做到这一点。我用过它,它对我来说效果很好。 github.com/akavbathen/pytest_html_merger
标签: pytest pytest-html pytest-xdist