O'Reilly logo
  • Chris Kang thinks this is interesting:

Or you can use --lf or --last-failed to just run the tests that failed the last time:

From

Cover of Python Testing with pytest

Note

Somehow pytest is caching which tests have failed and when.