py.test 多次测试运行的汇总结果

py.test aggregate results of multiple test runs

我是 运行 几个 pytest.main() 的实例,一旦它们全部完成,我想快速查看所有运行中的失败,而无需查看所有单独的报告。我该怎么做?

我是否必须解析文本报告,或者我能否获取 py.test 至 return 具有故障数据的对象? (据我所知,它只是 return 一个整数)

为此我使用了 Allure 报告 (https://docs.qameta.io/allure/#_pytest)。

您可以 运行 每个 pytest.main() 选项 --alluredir= 其中每个实例都有不同的路径,例如 /path/to/reports/report1、/path/to/reports/report2.

所有运行完成后,您可以通过运行ning命令allure serve /path/to/reports生成一份合并报告。更多关于生成报告的信息:https://docs.qameta.io/allure/#_get_started