我采用的参数为:--workers=1 --tests-per-worker 1,在 pytest.ini 中增加了这个参数,执行 pytest.main(),然后采用 allure generate ' + allure_path + ' -o ' + reports_path + ' --clean' 生成对应的测试报告,却无法生成测试报告,allure_path 也为空,把这个参数去掉,却可以生成。 麻烦大佬们解答下,感谢。
在社区帖上面找到了答案,采用 pytest-parallel 多线程时,目前不支持 allure 报告,这个是一个缺陷,我用 pytest-html 替代了。 地址: https://github.com/browsertron/pytest-parallel/issues/28#issuecomment-535345123