unittest.TestLoader creates a TestSuite before calling load_tests. Issue 7799.

This commit is contained in:
Michael Foord 2010-02-06 00:22:26 +00:00
parent 2373926964
commit 0877060f86
2 changed files with 4 additions and 1 deletions

View file

@ -71,9 +71,10 @@ class TestLoader(object):
tests.append(self.loadTestsFromTestCase(obj))
load_tests = getattr(module, 'load_tests', None)
tests = self.suiteClass(tests)
if use_load_tests and load_tests is not None:
return load_tests(self, tests, None)
return self.suiteClass(tests)
return tests
def loadTestsFromName(self, name, module=None):
"""Return a suite of all tests cases given a string specifier.