Hi Simon, 

i think i can whip up an example.  One question though: Do you already have a
view on how you want to to group tests in your source code?  In principle you
can do this by classes/modules or by decorators - or by having custom ways. 

cheers,
holger

On Tue, May 11, 2010 at 10:44 +0100, Simon Callan wrote:
> Hi,
> 
> I'm trying to understand how to implement setup() and teardown() functions,
> but finding it a bit difficult.
> 
> What I want is the following:
> 1) A setup() teardown() executed when the test process starts and stops.
> 2) A setup() teardown() executed when a group of tests are started
> /finished.
> 3) A setup() / teardown() executed when a test is run.
> 
> I.e., something like this:
> global_setup()
>   group1_setup()
>     setup()
>       test_1()
>     teardown()
>     setup()
>       test_2()
>     teardown()
>     setup()
>       test_3()
>     teardown()
>   group1_teardown()
>   group2_setup()
>     setup()
>       test_4()
>     teardown()
>     setup()
>       test_5()
>     teardown()
>     setup()
>       test_6()
>     teardown()
>   group2_teardown()
> global_teardown()
> 
> Is this possible? The documentation implies that it should be possible, but
> I cannot figure it out.
> 
> Simon
> 
> Infoshare Ltd
> Millennium House
> 21 Eden Street
> Kingston upon Thames
> Surrey
> KT1 1BL
> United Kingdom
> 
> Phone:                + 44 (0) 20 8541 0111
> Support:      + 44 (0) 20 8481 4760
> Web:          www.infoshare-is.com
> E-mail:               i...@infoshare-is.com
> 
> Infoshare Ltd is registered in England and Wales.
> Registered Office as above.
> Registered Number 2877612
> VAT Number GB 678 1443 10
> 
> The content of this e-mail (and any attachment to it) is confidential. 
> Any views or opinions do not represent the views or opinions 
> of Infoshare Ltd.
> If you have received this e-mail in error please notify the sender 
> and delete it. You may not use, copy or disclose the information 
> in any way. 
> 
> Infoshare Ltd monitors incoming and outgoing e-mails.
> 
> Please consider the environment. Do you really need to print 
> this email?
> 
> 
> _______________________________________________
> py-dev mailing list
> py-dev@codespeak.net
> http://codespeak.net/mailman/listinfo/py-dev
> 

-- 
_______________________________________________
py-dev mailing list
py-dev@codespeak.net
http://codespeak.net/mailman/listinfo/py-dev

Reply via email to