Author pitrou
Recipients gregory.p.smith, michael.foord, pitrou, rbcollins
Date 2009-04-04.23:02:27
SpamBayes Score 7.46574e-06
Marked as misclassified No
Message-id <1238886148.76.0.59826319843.issue5679@psf.upfronthosting.co.za>
In-reply-to
Content
>    def setUp(self):
>         dirname = mkdtemp()
>         self.addCleanup(shutils.rmtree, dirname, ignore_errors=True)
>         db = make_db(dirname)
>         self.addCleanup(db.tearDown)

Sure, but that's an example of doing something which is already doable
without addCleanup (resource allocation in setUp).
I was talking about doing resource allocation in the test methods
themselves, which is /only/ possible using addCleanup, and needs
cleanups to be run before tearDown, not after.
History
Date User Action Args
2009-04-04 23:02:28pitrousetrecipients: + pitrou, gregory.p.smith, rbcollins, michael.foord
2009-04-04 23:02:28pitrousetmessageid: <1238886148.76.0.59826319843.issue5679@psf.upfronthosting.co.za>
2009-04-04 23:02:27pitroulinkissue5679 messages
2009-04-04 23:02:27pitroucreate