<p><code>pytest-xdist</code> allows you to run failing tests in a loop inside a subprocess until it passes by looking for file changes to re-run previously failing tests. You can take advantage of it by having <code>pytest-xdist</code> installed and passing the command line flag <code>-f</code> or <code>--looponfail</code> to your pytest command. For more info see: #xdist-pytest-distributed-testing-plugin</p>