1、 pytest 框架如何去运行上次失败的测试用例:--lf
pytest.main(['-vs','--clean-allurredir','./test_case','--alluredir=allure-results','--lf'])
2、 pytest --ff 运行用例的路径 --- 运行上次所有的用例,优先运行上次失败的
pytest.main(['-vs','--clean-allurredir','./test_case','--alluredir=allure-results','--ff'])
(如果没有写路径,则执行当前目录下所有的用例)
或pytest.ini文件设置
[pytest]
addopts = --lf
运行上次所有的用例优先执行上次失败的
[pytest]
addopts = --lf