[TIP] cleanUp for unittest
Scott David Daniels
Scott.Daniels at Acm.Org
Tue Apr 7 10:20:52 PDT 2009
Fred Drake wrote:
> On Tue, Apr 7, 2009 at 11:58 AM, Olemis Lang <olemis at gmail.com> wrote:
>
>>> This relies on Python's garbage collector implementation details (i.e.
>>> refcounting),
>>>
>> That's th idea ;)
>>
>
> This seems to make it very easy to create fragile fixtures
> unintentionally, since not all Python implementations share the same
> garbage collection semantics.
It is also conceivable that, in the event of a test failure, a reference
is held longer
into the test by virtue of the traceback itself being a reference for a
while. I'd
not put it past some elaborate error reporting schemes to hold onto such
things.
> A simple stack of cleanup operations is just drop-dead simple, so is
> hard to beat.
Couldn't agree more.
--Scott David Daniels
Scott.Daniels at Acm.Org
More information about the testing-in-python
mailing list