diff options
author | Michael Foord <fuzzyman@voidspace.org.uk> | 2010-04-02 21:42:47 (GMT) |
---|---|---|
committer | Michael Foord <fuzzyman@voidspace.org.uk> | 2010-04-02 21:42:47 (GMT) |
commit | 5637f04a94242b6b696cf699625f708ce4ecb186 (patch) | |
tree | 0a0b0fe31aca0b938febc93c0ebba9c1c7165a8f /Lib/unittest/runner.py | |
parent | 51f2f16ee395449cd669d3378656d338df4ff5f1 (diff) | |
download | cpython-5637f04a94242b6b696cf699625f708ce4ecb186.zip cpython-5637f04a94242b6b696cf699625f708ce4ecb186.tar.gz cpython-5637f04a94242b6b696cf699625f708ce4ecb186.tar.bz2 |
Addition of -b command line option to unittest for buffering stdout and stderr during test runs.
Diffstat (limited to 'Lib/unittest/runner.py')
-rw-r--r-- | Lib/unittest/runner.py | 4 |
1 files changed, 3 insertions, 1 deletions
diff --git a/Lib/unittest/runner.py b/Lib/unittest/runner.py index 5169d20..068aa5b 100644 --- a/Lib/unittest/runner.py +++ b/Lib/unittest/runner.py @@ -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: |