pytest用例失败重跑的方法


Test_Login:
    (==)
    (=)
    ():
        test.Primary.driver.get()
        bool_success = LoginSystem(test.Primary.driver).login_openiot()
        bool_success

用例失败重跑的方法

  1. 在用例上添加装饰器@pytest.mark.flaky(reruns=2, reruns_delay=4)  reruns为次数,reruns_delay间隔时间,单位s

  2. 安装pytest-rerunfailures依赖包,在pytest.ini文件中addopts = 添加参数–reruns n (n:为重试的次数)(有待测试)


猜你喜欢

转载自blog.51cto.com/11463754/2470574
今日推荐