Antoine Pitrou <pit...@free.fr> added the comment: > 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. ---------- _______________________________________ Python tracker <rep...@bugs.python.org> <http://bugs.python.org/issue5679> _______________________________________ _______________________________________________ Python-bugs-list mailing list Unsubscribe: http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com