执行用例失败后重新运行

场景: 

• 测试失败后要重新运行n次,要在重新运行之间添加延迟时 间,间隔n秒再运行。

• 执行:
• 安装:pip install pytest-rerunfailures


• pytest -v - -reruns 5 --reruns-delay 1   ---每次等1秒 重试5次

 

pip3 install pytest-assume   断言后继续执行,但要修改断言 

 

@pytest.mark.parametrize(('x', 'y'), [(1, 1), (1, 0), (0, 1)])
def test_assume(x, y):
pytest.assume(x == y)
pytest.assume(3 == 4)
pytest.assume(5 == 9)

 

posted on 2019-09-22 13:24  barton123  阅读(358)  评论(0)    收藏  举报

导航