Message151444
Back on topic...
While I can see the advantage of parameterisation at the level of individual tests, I'm not at all clear on the benefits at the TestCase level.
For CPython's own test suite, if we want to share tests amongst multiple test cases, we just use ordinary inheritance. You get parameterisation pretty much for free with that approach:
class _BaseTest(object):
# Tests go here
# setUp and tearDown often go here, too
class FooTestCase(_BaseTest, TestCase):
# Parameter settings go here
class BarTestCase(_BaseTest, TestCase):
# Parameter settings go here
If you want to get data-driven about it, you can also do dynamic TestCase creation based on a sequence of parameter sets.
So, absent a compelling explanation for why the ordinary inheritance mechanisms aren't adequate, I'd be in favour of closing this one. |
|
Date |
User |
Action |
Args |
2012-01-17 11:33:16 | ncoghlan | set | recipients:
+ ncoghlan, terry.reedy, exarkun, pitrou, diekhans, ezio.melotti, eric.araujo, r.david.murray, michael.foord, brian.curtin, fperez, Yaroslav.Halchenko, nchauvat, abingham, eric.snow, pere.martir |
2012-01-17 11:33:16 | ncoghlan | set | messageid: <1326799996.01.0.606666939523.issue12600@psf.upfronthosting.co.za> |
2012-01-17 11:33:15 | ncoghlan | link | issue12600 messages |
2012-01-17 11:33:15 | ncoghlan | create | |
|