Python @pytest.mark.flaky(reruns=2, , reruns_delay=2) 打包无效

cs598703467 · November 02, 2023 · 1932 hits

pytest 单条用例本地 py 执行的时候,用例错误还是会重试 2 次,但是打包好,失败就只会执行一次,有没有大神知道怎么解决?

上层入口就是如下代码:
args = ["-vs", "--alluredir", allure_temp, test_path, '-W', 'ignore:Module already imported:pytest.PytestWarning', '--clean-alluredir']
pytest.main(args=args, plugins=[allure_pytest_plugin])

如果不加"--reruns=2"则失败也不重跑,加了的话,打包好提示不识别 error: unrecognized arguments: --reruns=2
我的 pytest 的版本是: 7.4.3, pytest-rerunfailures 版本是: 12.0, python 版本是 3.11

No Reply at the moment.
需要 Sign In 后方可回复, 如果你还没有账号请点击这里 Sign Up