[TIP] [nose] any way to just run tests that failed in the previous run?

Jonathan Lange jml at mumak.net
Thu Jun 21 03:02:37 PDT 2012


On Thu, Jun 21, 2012 at 11:00 AM, Chris Withers <chris at simplistix.co.uk> wrote:
> Hi All,
>
> Is there a plugin or some option I'm missing that would let me say "please
> just run the tests that failed in the last run?"
>
> The use case I have is making changes to a suite containing around 3300
> tests, which takes around 20 mins to run completely. For obvious reasons, I
> don't want to run all the tests all the time, but if I make a systematic
> change, I do want to make sure they all pass.
>
> The workflow I'd like to use is:
>
> - make change that will affect quite a few tests
> - run all tests to see what breaks
> - fix breakages
> - run only tests that failed
> - rinse and repeat
> - do one final run of all tests to be safe
>
> Anyone know of anything that'd help?
>

If you can somehow get nose to spit out subunit[1] format results,
then testr[2] does exactly this.

 $ testr run
 $ testr run --failing
 # ... repeat!

cheers,
jml

[1] http://pypi.python.org/pypi/python-subunit
[2] http://pypi.python.org/pypi/testrepository



More information about the testing-in-python mailing list