[TIP] Meta-test methods...

Robert Collins robertc at robertcollins.net
Thu Apr 23 22:25:33 PDT 2009

On Fri, 2009-04-24 at 00:01 -0400, Douglas Philips wrote:
> Anyway, I double-dare you pay attention to the issue at hand. :)
> I never said generators were bad. I said that checking a test method  
> for being a generator was a hack, seeminly cool at first, but upon  
> further thought it is just as a proof of concept that it is useful
> to  
> have a way to dynamically generate a sequence of test
> methods/functions.
> Testing only for generators is both opaque and, critically, fails to  
> generalize to arbitrary python sequences.

At least in unittest, you can do this just by generating whatever tests
you want in TestSuite.__iter__.

countTestCases clearly can't do a lot there, but that is the only method
in the protocol that conflicts with generation.

-------------- next part --------------
A non-text attachment was scrubbed...
Name: not available
Type: application/pgp-signature
Size: 197 bytes
Desc: This is a digitally signed message part
Url : http://lists.idyll.org/pipermail/testing-in-python/attachments/20090424/247dd7f4/attachment.pgp 

More information about the testing-in-python mailing list