[TIP] Fail-fast testing?
marius at gedmin.as
Fri Mar 5 14:02:07 PST 2010
On Fri, Mar 05, 2010 at 11:40:30AM -0500, 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?
> 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.
I assume people who will be implementing this will have considered the
case of an infinite loop and will make the second Ctrl-C interrupt the
test instead of waiting, and so I don't really need to bring this point
> 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.
Both nose and py.test also have this, called -x or --stop.
P.S. Both of my +1 mean "these are Good Things to have in a test runner,
but I wasn't paying attention and so I don't know if unittest/unittest2
is going to become a full-featured test runner". Reading mail backlogs
in reverse date order has certain downsides.
EMACS is a good OS. The only thing it lacks is a decent text-editor.
-------------- next part --------------
A non-text attachment was scrubbed...
Name: not available
Size: 197 bytes
Desc: Digital signature
More information about the testing-in-python