pytest run only failed test 1

pytest run only failed test

pytest --last-failed

Here is what the above code is Doing:
1. We’re using the pytest-xdist plugin to run our tests in parallel.
2. We’re using the –last-failed option to re-run only the tests that failed in the last run.
3. We’re using the –maxfail=1 option to stop the test run after the first failure.
4. We’re using the –looponfail option to re-run the failed tests in a loop until they pass.
5. We’re using the –maxfail=1 option to stop the test run after the first failure.
6. We’re using the –looponfail option to re-run the failed tests in a loop until they pass.

Similar Posts