码迷,mamicode.com
首页 > 其他好文 > 详细

执行用例失败后重新运行

时间:2019-09-22 14:43:34      阅读:90      评论:0      收藏:0      [点我收藏+]

标签:run   pre   delay   tle   之间   cti   class   重试   sum   

场景: 

• 测试失败后要重新运行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)

 

执行用例失败后重新运行

标签:run   pre   delay   tle   之间   cti   class   重试   sum   

原文地址:https://www.cnblogs.com/QaStudy/p/11567139.html

(0)
(0)
   
举报
评论 一句话评论(0
登录后才能评论!
© 2014 mamicode.com 版权所有  联系我们:gaon5@hotmail.com
迷上了代码!