GeezerVison is showing github.com — gh-131178: Use `support.captured_stdout` and `support.captured_stderr` by donbarbos · Pull Request #137748 · python/cpython
Conversation
donbarbos
commented
Aug 14, 2025
•
edited by bedevere-app
Bot
Loading
Uh oh!
There was an error while loading. Please reload this page.
I replaced contextlib.redicrect_std{out,err} and support.captured_output("std{out,err}") with support.captured_std{out,err}
Inspired by #131287 (comment). I went beyond older PRs, I thought that in other tests this change is also relevant
Sorry, something went wrong.
Uh oh!
There was an error while loading. Please reload this page.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Just change the recent CLI tests, not the rest. It produces too much churn otherwise. Serhiy was also against a global change
Sorry, something went wrong.
Uh oh!
There was an error while loading. Please reload this page.
donbarbos reacted with thumbs up emoji
Just change the recent CLI tests, not the rest. It produces too much churn otherwise. Serhiy was also against a global change
Ok, and I found that test_unknown_flag in test_platform has assertStartsWith inside assertRaises, I hope you don't mind fixing it in the current PR
|
Sorry, something went wrong.
Uh oh!
There was an error while loading. Please reload this page.
|
Mmh, I really prefer separate commits as we could eventually not decide to change the capture_stdout() (I'll need to see the final changes and see if it's really a gain as there is also a backport question).
There won't be an opposition to fixing the test but there might be slight opposition in refactoring. I am travelling now so I suggest fixing the test first, pinging a core dev such as Adam Turner for the merge and wait for me to come back for the capture_stdout() change.
|
donbarbos reacted with thumbs up emoji
Sorry, something went wrong.
Uh oh!
There was an error while loading. Please reload this page.
|
See #136632 for a previous discussion about changing tests to use the support.captured_* helpers.
|
Sorry, something went wrong.
Uh oh!
There was an error while loading. Please reload this page.
|
This is a code churn. Please leave it as is.
|
AA-Turner reacted with thumbs up emoji
Sorry, something went wrong.
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
Assignees
No one assigned
Milestone
No milestone
Development
Successfully merging this pull request may close these issues.
Uh oh!
There was an error while loading. Please reload this page.
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
|