[TIP] cleanUp for unittest
dgou at mac.com
Sun Apr 5 18:05:13 PDT 2009
On or about 2009 Apr 4, at 1:24 PM, Scott David Daniels indited:
> Doug Philips asks:
> > I think having this an tearDown is a recipe for confusion.
> > Can you explain how this interacts with tearDown, specifically,
> > if I have this, why would I ever put anything into tearDown?
> Much of a tearDown can be done regardless of the machine's normal
> state, because you can depend on the machine being properly
> initialized. Tests may do things that have to be undone, but
> sometimes they move past those to get back to a simple state.
> Those undos don't belong on the stack.
I'm a bit lost with all the pronouns there.
Maybe a concrete psuedo-example would help me understand which things
you would cleanUp and which would be tearDown.
More information about the testing-in-python