[TIP] new test parametrization / deprecating "yield"

Douglas Philips dgou at mac.com
Thu May 14 22:30:44 PDT 2009


On 2009 May 14, at 3:55 PM, Michael Foord wrote:
> I like the decorator syntax. I've updated my recipe to use it. :-)
>
> http://code.google.com/p/unittest-ext/source/browse/trunk/params.py

If I grok right, the metaclass will actually inject new synthetic test  
methods into the class definition?

I'm also not real clear on why the synthetic method (test, until it is  
given a new .__name__ and stored in the class under a new name) cannot  
just call 'item' instead of doing getattr (you'd still need to do the  
closure hack of having an 'item=item' optional parameter the way you  
do with name). But its late here and maybe I'm just not seeing  
something obvious...

-Doug




More information about the testing-in-python mailing list