Revision 2fe9deec test/py/testutils.py
b/test/py/testutils.py | ||
---|---|---|
103 | 103 |
else: |
104 | 104 |
raise Exception("Assertion not evaluated") |
105 | 105 |
|
106 |
# The following piece of code is a backport from Python 2.6. Python 2.4/2.5 |
|
107 |
# only accept class instances as test runners. Being able to pass classes |
|
108 |
# reduces the amount of code necessary for using a custom test runner. |
|
109 |
# 2.6 and above should use their own code, however. |
|
110 |
if (self.testRunner and sys.hexversion < 0x2060000 and |
|
111 |
isinstance(self.testRunner, (type, types.ClassType))): |
|
112 |
try: |
|
113 |
self.testRunner = self.testRunner(verbosity=self.verbosity) |
|
114 |
except TypeError: |
|
115 |
# didn't accept the verbosity argument |
|
116 |
self.testRunner = self.testRunner() |
|
117 |
|
|
118 | 106 |
return unittest.TestProgram.runTests(self) |
119 | 107 |
|
120 | 108 |
|
Also available in: Unified diff