Author michael.foord
Recipients michael.foord
Date 2009-04-03.19:56:45
SpamBayes Score 1.04436e-09
Marked as misclassified No
Message-id <1238788607.78.0.0557494613751.issue5679@psf.upfronthosting.co.za>
In-reply-to
Content
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)
History
Date User Action Args
2009-04-03 19:56:48michael.foordsetrecipients: + michael.foord
2009-04-03 19:56:47michael.foordsetmessageid: <1238788607.78.0.0557494613751.issue5679@psf.upfronthosting.co.za>
2009-04-03 19:56:46michael.foordlinkissue5679 messages
2009-04-03 19:56:45michael.foordcreate