Message85445
> 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. |
|
| Date |
User |
Action |
Args |
| 2009-04-04 23:02:28 | pitrou | set | recipients:
+ pitrou, gregory.p.smith, rbcollins, michael.foord |
| 2009-04-04 23:02:28 | pitrou | set | messageid: <[email protected]> |
| 2009-04-04 23:02:27 | pitrou | link | issue5679 messages |
| 2009-04-04 23:02:27 | pitrou | create | |
|