Re: Art of Unit Testing
- From: zen19725@xxxxxxxxx (phil hunt)
- Date: Wed, 3 Aug 2005 13:31:33 +0100
On Tue, 02 Aug 2005 21:26:28 +0200, Christoph Zwerschke <cito@xxxxxxxxx> wrote:
>Björn Lindström wrote:
>>>Would it make sense to add "globaleSetup" and "globalTearDown" methods
>>>to the TestCase class?
>> In general that's not such a good idea.
>
>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.
Indeed. Running the tests should ideally take less than a few
seconds. Any longer, and people won't use them so often.
--
Email: zen19725 at zen dot co dot uk
.
- Follow-Ups:
- Re: Art of Unit Testing
- From: Peter Hansen
- Re: Art of Unit Testing
- References:
- Art of Unit Testing
- From: Christoph Zwerschke
- Re: Art of Unit Testing
- From: Björn Lindström
- Re: Art of Unit Testing
- From: Christoph Zwerschke
- Art of Unit Testing
- Prev by Date: Re: Parallel port programming on windows XP/2000?
- Next by Date: Re: Art of Unit Testing
- Previous by thread: Re: Art of Unit Testing
- Next by thread: Re: Art of Unit Testing
- Index(es):