[TIP] Fail-fast testing?

Michael Foord fuzzyman at voidspace.org.uk
Fri Mar 5 08:43:40 PST 2010


On 05/03/2010 16:40, J. Cliff Dyer wrote:
> Would it be possible to get something like the fail-fast features that
> have been incorporated into django 1.2 included in unittest somehow?
>    

Submit a feature request on bugs.python.org.

Michael

> There are two improvements that I think could be generally useful.
>
> http://code.djangoproject.com/changeset/12034 provides a Ctrl-C override
> (using the signals module), which prevents the test runner from dying
> with an exception on Ctrl-C, and instead finishes the current test, and
> returns the results up to that point.  The output looks like this:
>
> $ ./manage.py test
> [Snipped test setup]
> .........................^C<Test run halted by Ctrl-C>  .
> ----------------------------------------------------------------------
> Ran 26 tests in 1.488s
>
> OK
> Destroying test database 'default'...
>
>
> http://code.djangoproject.com/changeset/11843 provides a --failfast
> option which exits the test run after the first failure, showing all
> test output up to that point.  Both of these are great options to have
> available when working with large test suites.
>
> I'd be happy to put in some legwork if there were interest in having
> this functionality available in unittest.
>
> Cheers,
> Cliff
>
>
> _______________________________________________
> testing-in-python mailing list
> testing-in-python at lists.idyll.org
> http://lists.idyll.org/listinfo/testing-in-python
>    


-- 
http://www.ironpythoninaction.com/
http://www.voidspace.org.uk/blog

READ CAREFULLY. By accepting and reading this email you agree, on behalf of your employer, to release me from all obligations and waivers arising from any and all NON-NEGOTIATED agreements, licenses, terms-of-service, shrinkwrap, clickwrap, browsewrap, confidentiality, non-disclosure, non-compete and acceptable use policies (”BOGUS AGREEMENTS”) that I have entered into with your employer, its partners, licensors, agents and assigns, in perpetuity, without prejudice to my ongoing rights and privileges. You further represent that you have the authority to release me from any BOGUS AGREEMENTS on behalf of your employer.





More information about the testing-in-python mailing list