执行失败了的用例可以按照一定频率去跑多次,频率+次数
reruns=2 重跑次数
reruns_delay=2 频率
import pytest
@pytest.mark.flaky(reruns=2,reruns_delay=2) # 只要失败的就重跑
@pytest.mark.parametrize('a', [100, 200, 300])
def test_001(a):
assert a == 200
if __name__ == '__main__':
pytest.main(['pytest_重跑失败用例的机制.py', '-s'])