I have a number of unit tests organised hierarchically, all of which
inherit fixtures from a base class. To run these all at once I started
out using
from basic import map, directionalpan, layerorder, layervisibility ,
listlayers, streamlayerlist
# ... lots more ...
suite0 =
unittest.TestLo ader().loadTest sFromTestCase(d irectionalpan.T estPan)
suite1 =
unittest.TestLo ader().loadTest sFromTestCase(l ayerorder.TestL ayerorder)
# ... lots more ...
alltests = unittest.TestSu ite([suite0
, suite1
....])
unittest.TextTe stRunner(verbos ity=2).run(allt ests)
Which is unmaintainable. the TestLoader docs warn that
loadTestsFromMo dule will not play nicely with my situation and indeed
if I try
suite0 = unittest.TestLo ader().loadTest sFromModule(bas ic)
then run the tests, it hasn't picked any up. I suppose I could collect
and run the tests with a shell script...what are my options here to
avoid hardcoding and maintaining the list of tests, and how is it
normally done?
Thanks.
inherit fixtures from a base class. To run these all at once I started
out using
from basic import map, directionalpan, layerorder, layervisibility ,
listlayers, streamlayerlist
# ... lots more ...
suite0 =
unittest.TestLo ader().loadTest sFromTestCase(d irectionalpan.T estPan)
suite1 =
unittest.TestLo ader().loadTest sFromTestCase(l ayerorder.TestL ayerorder)
# ... lots more ...
alltests = unittest.TestSu ite([suite0
, suite1
....])
unittest.TextTe stRunner(verbos ity=2).run(allt ests)
Which is unmaintainable. the TestLoader docs warn that
loadTestsFromMo dule will not play nicely with my situation and indeed
if I try
suite0 = unittest.TestLo ader().loadTest sFromModule(bas ic)
then run the tests, it hasn't picked any up. I suppose I could collect
and run the tests with a shell script...what are my options here to
avoid hardcoding and maintaining the list of tests, and how is it
normally done?
Thanks.
Comment