[New-bugs-announce] [issue36647] TextTestRunner doesn't honour "buffer" argument

José Luis Segura Lucas report at bugs.python.org
Wed Apr 17 10:24:22 EDT 2019


New submission from José Luis Segura Lucas <josel.segura at gmail.com>:

When using "buffer = True" in a TextTestRunner, the test result behaviour doesn't change at all.

This is because TextTestRunner.stream is initialised using a decorator (_WritelnDecorator). When "buffer" is passed, the TestResult base class will try to redirect the stdout and stderr to 2 different io.StringIO objects. As the TextTestRunner.stream is initialised before that "redirection", all the "self.stream.write" calls will end using the original stream (stderr by default), and resulting in not buffering at all.

----------
components: Tests
messages: 340398
nosy: José Luis Segura Lucas
priority: normal
severity: normal
status: open
title: TextTestRunner doesn't honour "buffer" argument
type: behavior
versions: Python 3.7

_______________________________________
Python tracker <report at bugs.python.org>
<https://bugs.python.org/issue36647>
_______________________________________


More information about the New-bugs-announce mailing list