Message85321
Proposal to add a cleanUp stack to unittest.TestCase. This is a list of
callables to be called (LIFO) to cleanup resources. If there are items
on the stack it should be called even if setUp fails. Otherwise it
should be called after tearDown.
Similar functionality is in the testing frameworks used by bzr, Twisted,
and Zope.
I will create a patch similar to the bzr implementation.
The public API is via a new method:
def addCleanUpItem(self, callable, *args, **kwargs):
Usage is:
self.db = self.createDB()
self.addCleanUpItem(self.db.close) |
|
Date |
User |
Action |
Args |
2009-04-03 19:56:48 | michael.foord | set | recipients:
+ michael.foord |
2009-04-03 19:56:47 | michael.foord | set | messageid: <1238788607.78.0.0557494613751.issue5679@psf.upfronthosting.co.za> |
2009-04-03 19:56:46 | michael.foord | link | issue5679 messages |
2009-04-03 19:56:45 | michael.foord | create | |
|