[TIP] Fwd: cleanUp for unittest
fdrake at gmail.com
Fri Apr 3 13:45:10 PDT 2009
On Fri, Apr 3, 2009 at 4:25 PM, Michael Foord <fuzzyman at voidspace.org.uk> wrote:
> Well, on the feature under discussion Zope, Twisted and Bzr have all
> provided it without modifying TestCase but have had to write a lot more
> code as a result...
Most important is that code that can't assume the feature is available
can't use it, unless it can also arrange for the corresponding cleanup
phase itself (IOW, re-implement the feature).
We often have packages that provide testing support for client code,
and that wants to register cleanup functions. Even with a custom
TestCase class (which zope.testing doesn't provide, for reasons
unknown to me), this requires that libraries require client code to be
run with the specialized TestCase. This might be acceptable, but
that's not entirely clear to me.
A great deal of value comes from this being part of the TestCase
contract out of the box.
Fred L. Drake, Jr. <fdrake at gmail.com>
"Chaos is the score upon which reality is written." --Henry Miller
More information about the testing-in-python