4 ms·
The `--last-failed` option will change my life! <3
by fermigier 9y ago
The `--last-failed` option will change my life! <3
- masklinn 9y agoFWIW it was added back in 2.8.0 (though only as a short `--lf` options). 3.2.0 makes it smarter by improving the first-failed/last-failed clear behaviour: it now only clears tests which have succeeded. You can see the use case in the PR: make a change, it breaks a lot of tests, then fix module par module e.g. after an initial `pytest` (failed lots) fix `pytest core --lf`, then fix `pytest controller --lf`, … the problem pre-3.2 is that `pytest core --lf` would reset the cache with only its own failures, so the subsequent `pytest controller —lf` would start with an empty cache and run every single test rather than only those which had previously failed. This is problematic when you have a large expensive testing base (e.g. so much so that you xdist it, as the original PR did)