summaryrefslogtreecommitdiffstats
path: root/Lib/unittest/runner.py
diff options
context:
space:
mode:
authorMichael Foord <fuzzyman@voidspace.org.uk>2010-12-30 19:36:29 (GMT)
committerMichael Foord <fuzzyman@voidspace.org.uk>2010-12-30 19:36:29 (GMT)
commit6f17e2df29a865a29447531e89fb22be710e382d (patch)
tree62c939a3e7eee02f8f6372dac306c9af93f4945a /Lib/unittest/runner.py
parent30baf2b0eda97fa8a36fddc81824b5772d764018 (diff)
downloadcpython-6f17e2df29a865a29447531e89fb22be710e382d.zip
cpython-6f17e2df29a865a29447531e89fb22be710e382d.tar.gz
cpython-6f17e2df29a865a29447531e89fb22be710e382d.tar.bz2
Issue 10786: unittest.TextTestRunner default stream no longer bound at import time
Diffstat (limited to 'Lib/unittest/runner.py')
-rw-r--r--Lib/unittest/runner.py4
1 files changed, 3 insertions, 1 deletions
diff --git a/Lib/unittest/runner.py b/Lib/unittest/runner.py
index c5e4258..10c4778 100644
--- a/Lib/unittest/runner.py
+++ b/Lib/unittest/runner.py
@@ -125,8 +125,10 @@ class TextTestRunner(object):
"""
resultclass = TextTestResult
- def __init__(self, stream=sys.stderr, descriptions=True, verbosity=1,
+ def __init__(self, stream=None, descriptions=True, verbosity=1,
failfast=False, buffer=False, resultclass=None, warnings=None):
+ if stream is None:
+ stream = sys.stderr
self.stream = _WritelnDecorator(stream)
self.descriptions = descriptions
self.verbosity = verbosity