Art of Unit Testing
- From: Christoph Zwerschke <zwerschke@xxxxxxxxxxxxxxxxxxxxx>
- Date: Tue, 02 Aug 2005 18:44:01 +0200
In August 2001, there was a thread about the "Art of Unit Testing": http://groups.google.com/group/comp.lang.python/browse_frm/thread/aa2bd17e7f995d05/71a29faf0a0485d5
Paul Moore asked the legitimate question why there is no hook for a "global" fixture code that is run only once for the whole TestCase, as opposed to the normal "setUp" and "tearDown" code that is run for every single test in the TestCase. A "global fixture" would be preferable whenever creating the fixture is time consuming, e.g. you have to create a database connection or even a whole database.
What would be the preferred solution for such global fixtures? Simply create the database, run the TestCase, and drop the database?
Would it make sense to add "globaleSetup" and "globalTearDown" methods to the TestCase class? I think at least it would not harm anybody. Where should such proposals be submitted?
-- Christoph Zwerschke .
- Follow-Ups:
- Re: Art of Unit Testing
- From: phil hunt
- Re: Art of Unit Testing
- From: Björn Lindström
- Re: Art of Unit Testing
- From: Grig Gheorghiu
- Re: Art of Unit Testing
- Prev by Date: Re: __autoinit__ (Was: Proposal: reducing self.x=x; self.y=y; self.z=z boilerplate code)
- Next by Date: Re: Art of Unit Testing
- Previous by thread: a pickle's pickle
- Next by thread: Re: Art of Unit Testing
- Index(es):
Relevant Pages
|