diff options
author | Michael Foord <fuzzyman@voidspace.org.uk> | 2009-07-13 16:32:47 (GMT) |
---|---|---|
committer | Michael Foord <fuzzyman@voidspace.org.uk> | 2009-07-13 16:32:47 (GMT) |
commit | bee87b4c1cfa89f0ca17e72874a17ea0ad126489 (patch) | |
tree | da30abd0afd1f0bca2ca0326534b4996c1f36a94 /Lib/unittest.py | |
parent | f4a96e07d8ae7ba868c22c93dec0e2bef13d3383 (diff) | |
download | cpython-bee87b4c1cfa89f0ca17e72874a17ea0ad126489.zip cpython-bee87b4c1cfa89f0ca17e72874a17ea0ad126489.tar.gz cpython-bee87b4c1cfa89f0ca17e72874a17ea0ad126489.tar.bz2 |
Move initialising unittest.TestProgram.testRunner into runTests. Issue 6418.
Diffstat (limited to 'Lib/unittest.py')
-rw-r--r-- | Lib/unittest.py | 5 |
1 files changed, 3 insertions, 2 deletions
diff --git a/Lib/unittest.py b/Lib/unittest.py index 2ad5de7..74f15d6 100644 --- a/Lib/unittest.py +++ b/Lib/unittest.py @@ -800,8 +800,6 @@ Examples: def __init__(self, module='__main__', defaultTest=None, argv=None, testRunner=None, testLoader=defaultTestLoader): - if testRunner is None: - testRunner = TextTestRunner if type(module) == type(''): self.module = __import__(module) for part in module.split('.')[1:]: @@ -851,6 +849,9 @@ Examples: self.module) def runTests(self): + if self.testRunner is None: + self.testRunner = TextTestRunner + if isinstance(self.testRunner, (type, types.ClassType)): try: testRunner = self.testRunner(verbosity=self.verbosity) |