mirror of
https://github.com/python/cpython.git
synced 2025-07-30 06:34:15 +00:00
-f/--failfast command line option for unittest. Issue 8074. Documentation still needed. Plus minor change to test_unittest to allow it to be run with python -m test.unittest
This commit is contained in:
parent
b1aa30f94d
commit
1b9e95339d
4 changed files with 86 additions and 26 deletions
|
@ -124,10 +124,11 @@ class TextTestRunner(object):
|
|||
resultclass = TextTestResult
|
||||
|
||||
def __init__(self, stream=sys.stderr, descriptions=True, verbosity=1,
|
||||
resultclass=None):
|
||||
failfast=False, resultclass=None):
|
||||
self.stream = _WritelnDecorator(stream)
|
||||
self.descriptions = descriptions
|
||||
self.verbosity = verbosity
|
||||
self.failfast = failfast
|
||||
if resultclass is not None:
|
||||
self.resultclass = resultclass
|
||||
|
||||
|
@ -137,6 +138,7 @@ class TextTestRunner(object):
|
|||
def run(self, test):
|
||||
"Run the given test case or test suite."
|
||||
result = self._makeResult()
|
||||
result.failfast = self.failfast
|
||||
startTime = time.time()
|
||||
startTestRun = getattr(result, 'startTestRun', None)
|
||||
if startTestRun is not None:
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue