Merged revisions 78010 via svnmerge from

svn+ssh://pythondev@svn.python.org/python/trunk

........
  r78010 | michael.foord | 2010-02-06 00:22:26 +0000 (Sat, 06 Feb 2010) | 1 line

  unittest.TestLoader creates a TestSuite before calling load_tests. Issue 7799.
........
This commit is contained in:
Michael Foord 2010-02-06 00:26:13 +00:00
parent b112a41aa3
commit 41647d6dad
2 changed files with 4 additions and 1 deletions

View file

@ -272,12 +272,14 @@ class Test_TestLoader(TestCase):
load_tests_args = []
def load_tests(loader, tests, pattern):
self.assertIsInstance(tests, unittest.TestSuite)
load_tests_args.extend((loader, tests, pattern))
return tests
m.load_tests = load_tests
loader = unittest.TestLoader()
suite = loader.loadTestsFromModule(m)
self.assertIsInstance(suite, unittest.TestSuite)
self.assertEquals(load_tests_args, [loader, suite, None])
load_tests_args = []