mirror of
https://github.com/python/cpython.git
synced 2025-09-20 15:40:32 +00:00
Addition of -b command line option to unittest for buffering stdout and stderr during test runs.
This commit is contained in:
parent
51f2f16ee3
commit
5637f04a94
5 changed files with 217 additions and 14 deletions
|
@ -125,11 +125,12 @@ class TextTestRunner(object):
|
|||
resultclass = TextTestResult
|
||||
|
||||
def __init__(self, stream=sys.stderr, descriptions=True, verbosity=1,
|
||||
failfast=False, resultclass=None):
|
||||
failfast=False, buffer=False, resultclass=None):
|
||||
self.stream = _WritelnDecorator(stream)
|
||||
self.descriptions = descriptions
|
||||
self.verbosity = verbosity
|
||||
self.failfast = failfast
|
||||
self.buffer = buffer
|
||||
if resultclass is not None:
|
||||
self.resultclass = resultclass
|
||||
|
||||
|
@ -141,6 +142,7 @@ class TextTestRunner(object):
|
|||
result = self._makeResult()
|
||||
registerResult(result)
|
||||
result.failfast = self.failfast
|
||||
result.buffer = self.buffer
|
||||
startTime = time.time()
|
||||
startTestRun = getattr(result, 'startTestRun', None)
|
||||
if startTestRun is not None:
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue