Addition of -c command line option to unittest, to handle ctrl-c during a test run more elegantly

This commit is contained in:
Michael Foord 2010-03-26 03:18:31 +00:00
parent ee627883a7
commit fa2f1cdcbb
6 changed files with 319 additions and 16 deletions

View file

@ -4,6 +4,7 @@ import sys
import time
from . import result
from .signals import registerResult
__unittest = True
@ -138,6 +139,7 @@ class TextTestRunner(object):
def run(self, test):
"Run the given test case or test suite."
result = self._makeResult()
registerResult(result)
result.failfast = self.failfast
startTime = time.time()
startTestRun = getattr(result, 'startTestRun', None)