| Trees | Index | Help |
|
|---|
| Package zope :: Package testing :: Module 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 | |
|---|---|
Register a cleanup routines | |
Clean up global data. | |
Clean up global data. | |
Clean up global data. | |
| Variable Summary | |
|---|---|
list |
_cleanups = [(<function _clear at 0xb6522d4c>, (), {}), ...
|
| Function Details |
|---|
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. |
| Variable Details |
|---|
_cleanups
|
| Trees | Index | Help |
|
|---|
| Generated by Epydoc 2.1 on Fri Jun 24 12:01:25 2005 | http://epydoc.sf.net |