[TIP] setUp and tearDown behavior
arufuredosan at gmail.com
Mon Jan 18 18:37:43 PST 2010
I am building some tests for a Python installer that copies some files and
changes some permissions.
Nothing weird there.
However, in the test class I am starting with a setUp that basically calls
the installer (so the tests can see if everything is where it should be),
this is followed by a few assertions and finally a tearDown is called where
everything gets uninstalled.
When running the tests with nosetests, I see that setUp and tearDown are
called for *every* method in my test class (e.g. installs => runs test
method => uninstalls ....)
Isn't setUp supposed to be run once at the beginning of the class? or is
In case this is expected, is there a way to do it *just once *for all the
-------------- next part --------------
An HTML attachment was scrubbed...
More information about the testing-in-python