[TIP] Test Parameterization with unittest

Michael Foord fuzzyman at voidspace.org.uk
Mon May 11 10:52:50 PDT 2009


Douglas Philips wrote:
> On 2009 May 11, at 12:33 PM, Michael Foord wrote:
>   
>> Currently trying to write tests for test discovery.
>>     
>
> What I did to get my current itch scratched was have a new method  
> prefix: "make_tests" - the unit test framework runs that and expects  
> it to return a sequence of TestCase instances to be run. It was the  
> simplest change I could make to get creating dynamic tests. You can  
> check the archives for details.
>   
In what context - testing test discovery or parameterizing tests?

It doesn't seem relevant to the former. For the latter I quite like 
dynamically creating test methods in a metaclass.

Michael

> -Doug
>
>
> _______________________________________________
> testing-in-python mailing list
> testing-in-python at lists.idyll.org
> http://lists.idyll.org/listinfo/testing-in-python
>   


-- 
http://www.ironpythoninaction.com/
http://www.voidspace.org.uk/blog





More information about the testing-in-python mailing list