Get the App
SLTechnology News&Howtos  ›  Internet Technology  › 

How to solve the pytest use case failure

Shulou Source: shulou.com Published: 2022-06-03 07:26:08 11月14日 Update

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

The method of rerunning in use case failure

Add decorator @ pytest.mark.flaky (reruns=2, reruns_delay=4) reruns to the use case for the number of times, reruns_delay interval (in s)

Install the pytest-rerunfailures dependency package, in the pytest.ini file addopts = add the parameter-reruns n (n: the number of retries) (to be tested)

Tags: Number unit parameter file method time test Apple Docker Huawei Linux macOS MariaDB Microsoft MySQL NVidia OPPO Reno Apple Shulou Technology Redmi Shulou Information Docker