Commit 8d2de3c4 authored by Nicolas Dumazet's avatar Nicolas Dumazet

Introduce DebugTextTestRunner to extend TextTestRunner instead of wrapping

test runs.


git-svn-id: https://svn.erp5.org/repos/public/erp5/trunk@30090 20353a03-c40f-0410-a6d1-a30d3c3de9de
parent 3be9c809
......@@ -332,14 +332,20 @@ def runUnitTestList(test_list, verbosity=1, debug=0):
# Hack the profiler to run only specified test methods, and wrap results when
# running in debug mode.
if not dummy_test:
if debug:
class DebugTextTestRunner(backportUnittest.TextTestRunner):
def _makeResult(self):
result = super(DebugTextTestRunner, self)._makeResult()
return DebugTestResult(result)
TestRunner = DebugTextTestRunner
test_method_list = os.environ.get('run_only', '').split(',')
def wrapped_run(run_orig):
# wrap the method that run the test to run test method only if its name
# matches the run_only spec and to provide post mortem debugging facility
def run(self, result=None):
if debug and result:
result = DebugTestResult(result)
if not test_method_list:
return run_orig(self, result)
test_method_name = self.id().rsplit('.', 1)[-1]
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment