Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.
def flattenTestSuite(test_suite):
tests = []
for test in test_suite:
if isinstance(test, unittest.BaseTestSuite):
tests.extend(flattenTestSuite(test))
else:
tests.append(test)
return GreenTestLoader.suiteClass(tests)