[TIP] new test parametrization / deprecating "yield"
fuzzyman at voidspace.org.uk
Fri May 15 02:31:01 PDT 2009
Douglas Philips wrote:
> On 2009 May 14, at 3:55 PM, Michael Foord wrote:
>> I like the decorator syntax. I've updated my recipe to use it. :-)
> 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...
item is the unbound method. getattr returns the bound method. I guess it
could call item(self, **args) but that code is actually unchanged from
the previous version...
> testing-in-python mailing list
> testing-in-python at lists.idyll.org
More information about the testing-in-python