I am using Python unittest with simple code:
suite = unittest.TestSuite() suite.addTest(unittest.defaultTestLoader.loadTestsFromTestCase(module1)) suite.addTest(unittest.defaultTestLoader.loadTestsFromTestCase(module2))
However, I want to do some custom stuff for each test after they have been packaged. I thought I could do something similar to iterate over test cases in a package:
print suite.countTestCases() for test in suite:
However, since there are as many test cases as I download, it only prints
3 <class 'unittest.suite.TestSuite'>
Is there a way to get all objects of class TestCase from a package? Is there any other way that I should download test cases to facilitate this?
source share