Re: Art of Unit Testing
- From: Christoph Zwerschke <cito@xxxxxxxxx>
- Date: Tue, 02 Aug 2005 21:26:28 +0200
Björn Lindström wrote:
In general that's not such a good idea.Would it make sense to add "globaleSetup" and "globalTearDown" methods to the TestCase class?
I completely agree and I think it makes a lot of sense that unittest calls setUp and tearDown for every single test. However, the fact that this is *generally* the best way doesn't exclude the fact that there are *exceptions* when it makes sense to setUp and tearDown not for every test, e.g. when it is absolutely sure that the fixture cannot be destroyed by the individual tests or when creating the fixture takes too much time. I already gave the example of creating database connections or even creating/importing whole databases. My question was, how do I handle these cases with the standard lib unittest?
According to the "extreme programming" paradigm, testing should be done several times a day. So a requirement for extreme programm is that tests are fast enough. If the testing needs too much time, people are discouraged to test often.
-- Christoph .
- Follow-Ups:
- Re: Art of Unit Testing
- From: phil hunt
- Re: Art of Unit Testing
- From: Peter Hansen
- Re: Art of Unit Testing
- From: rafi
- Re: Art of Unit Testing
- References:
- Art of Unit Testing
- From: Christoph Zwerschke
- Re: Art of Unit Testing
- From: Björn Lindström
- Art of Unit Testing
- Prev by Date: Re: a pickle's pickle
- Next by Date: Re: py2exe windows apps path question
- Previous by thread: Re: Art of Unit Testing
- Next by thread: Re: Art of Unit Testing
- Index(es):
Relevant Pages
|