def getFullTestName(test, full_test_names): tests = [] for full_test_name in full_test_names: if full_test_name.lower().find(test) != -1: tests.append(full_test_name) return tests
def loadTestsFromModule(self, module): """Return a suite of all tests cases contained in the given module""" tests = [] for name in dir(module): obj = getattr(module, name) if (isinstance(obj, (type, types.ClassType)) and issubclass(obj, unittest.TestCase)): if not self.alltests and hasattr(obj, 'slowTest') and obj.slowTest: print 'Ignoring slow test:', obj.__name__ self.ignored += 1 elif hasattr(obj, 'skipTest') and obj.skipTest(): print 'Skipping test:', obj.__name__, '-', obj.skipTest() self.skipped += 1 else: tests.append(self.loadTestsFromTestCase(obj)) return self.suiteClass(tests)