Re: decorators to add test* TestCase methods

2006-01-27 Thread Bruce Cropley
Many thanks for that! It looks like it's time to learn about metaclasses. :) -- http://mail.python.org/mailman/listinfo/python-list

Re: decorators to add test* TestCase methods

2006-01-27 Thread Peter Otten
Bruce Cropley wrote: > I'm trying to generate test methods in a unittest TestCase > subclass, using decorators. I'd like to be able to say: > > class MyTestCase(unittest.TestCase): > @genTests(["Buy", "Sell"], [1,2,3], [True, False]) > def something(self, side, price, someFlag): >

Re: decorators to add test* TestCase methods

2006-01-27 Thread Duncan Booth
Bruce Cropley wrote: > Hi all > > I'm trying to generate test methods in a unittest TestCase > subclass, using decorators. I'd like to be able to say: > > class MyTestCase(unittest.TestCase): > @genTests(["Buy", "Sell"], [1,2,3], [True, False]) > def something(self, side, price, someFla