Questions after testtools merge

Martin Pool mbp at canonical.com
Mon Jan 4 05:13:06 GMT 2010


2010/1/2 John Arbash Meinel <john at arbash-meinel.com>:

> As for whether tearDown comes before or after cleanups... I favor it
> coming after, but arguably it could go either. Most resources work very
> well in the LIFO that addCleanup provides, and it is unclear how that
> interacts with tearDown. (You can't put the child classes tearDown
> before the parent classes cleanups but after its tearDown, etc.)
>
> I would say a reasonable fix for *bzrlib* is to just deprecate tearDown
> entirely. (put it in our base TestCase), and then fix everything to use
> addCleanup.

I'd support deprecating it entirely, because it's something that can
easily be used incorrectly - not just the different behaviour in the
case of failures, but also that it's easy to forget to call the
parent.

Rather than deprecating it in our TestCase base, which would not catch
use that fails to upcall, I'd deprecate it in test_source.

-- 
Martin <http://launchpad.net/~mbp/>



More information about the bazaar mailing list