Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

TextTestRunner doesn't honour "buffer" argument #80828

Open
JosLuisSeguraLucas mannequin opened this issue Apr 17, 2019 · 1 comment
Open

TextTestRunner doesn't honour "buffer" argument #80828

JosLuisSeguraLucas mannequin opened this issue Apr 17, 2019 · 1 comment
Labels
3.7 (EOL) end of life tests Tests in the Lib/test dir type-bug An unexpected behavior, bug, or error

Comments

@JosLuisSeguraLucas
Copy link
Mannequin

JosLuisSeguraLucas mannequin commented Apr 17, 2019

BPO 36647

Note: these values reflect the state of the issue at the time it was migrated and might not reflect the current state.

Show more details

GitHub fields:

assignee = None
closed_at = None
created_at = <Date 2019-04-17.14:24:22.115>
labels = ['3.7', 'type-bug', 'tests']
title = 'TextTestRunner doesn\'t honour "buffer" argument'
updated_at = <Date 2019-04-17.14:24:22.115>
user = 'https://bugs.python.org/JosLuisSeguraLucas'

bugs.python.org fields:

activity = <Date 2019-04-17.14:24:22.115>
actor = 'Jos\xc3\xa9 Luis Segura Lucas'
assignee = 'none'
closed = False
closed_date = None
closer = None
components = ['Tests']
creation = <Date 2019-04-17.14:24:22.115>
creator = 'Jos\xc3\xa9 Luis Segura Lucas'
dependencies = []
files = []
hgrepos = []
issue_num = 36647
keywords = []
message_count = 1.0
messages = ['340398']
nosy_count = 1.0
nosy_names = ['Jos\xc3\xa9 Luis Segura Lucas']
pr_nums = []
priority = 'normal'
resolution = None
stage = None
status = 'open'
superseder = None
type = 'behavior'
url = 'https://bugs.python.org/issue36647'
versions = ['Python 3.7']

@JosLuisSeguraLucas
Copy link
Mannequin Author

JosLuisSeguraLucas mannequin commented Apr 17, 2019

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.

@JosLuisSeguraLucas JosLuisSeguraLucas mannequin added 3.7 (EOL) end of life tests Tests in the Lib/test dir type-bug An unexpected behavior, bug, or error labels Apr 17, 2019
@ezio-melotti ezio-melotti transferred this issue from another repository Apr 10, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
3.7 (EOL) end of life tests Tests in the Lib/test dir type-bug An unexpected behavior, bug, or error
Projects
None yet
Development

No branches or pull requests

0 participants