diff options
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) |
