Module zope.testing.cleanup
Provide a standard cleanup registry
Unit tests that change global data should include the CleanUp base
class, which provides simpler setUp and tearDown methods that call
global-data cleanup routines:
class Test(CleanUp, unittest.TestCase):
....
If custom setUp or tearDown are needed, then the base routines should
be called, as in:
def tearDown(self):
super(Test, self).tearDown()
....
Cleanup routines for global data should be registered by passing them
to addCleanup:
addCleanUp(pigRegistry._clear)
$Id: cleanup.py,v 1.2 2005/06/24 16:53:02 nyergler Exp $
Classes |
CleanUp |
Mix-in class providing clean-up setUp and tearDown routines. |
Function Summary |
|
addCleanUp (func,
args,
kw)
Register a cleanup routines |
|
cleanUp ()
Clean up global data. |
|
setUp ()
Clean up global data. |
|
tearDown ()
Clean up global data. |
addCleanUp(func,
args=(),
kw={})
Register a cleanup routines
Pass a function to be called to cleanup global data. Optional
argument tuple and keyword arguments may be passed.
-
|
cleanUp()
Clean up global data.
-
|
setUp()
Clean up global data.
-
|
tearDown()
Clean up global data.
-
|