GV

GeezerVison

The World Wide Web, restored to 800 pixels of glory.

Home|About|Gaming cabinet|Archives|How it works|Starter sites

On this site

  • Sign in
  • ActionsCI/CD and automation
  • CodespacesCloud development environments
  • All Features
  • Documentation
  • Training
  • Certifications
  • Build with Copilot
  • Customize Copilot
  • Integrations
  • Trending repos
  • GitHub Sponsors
  • Developer articles
  • Enterprises

This view

  • Original page
  • New address

GeezerVison is showing github.com — gh-131178: Use `support.captured_stdout` and `support.captured_stderr` by donbarbos · Pull Request #137748 · python/cpython

Conversation

@donbarbos

@donbarbos donbarbos commented Aug 14, 2025 •
edited by bedevere-app Bot
Loading

Uh oh!

There was an error while loading. Please reload this page.

Copy link
Copy Markdown
Contributor

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

  • Issue: Add tests for command-line interface #131178

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

All reactions
@donbarbos
pythongh-131178: Use support.captured_stdout() and `support.capture…
86a7158
…d_stderr()`
@donbarbos
donbarbos requested review from Eclips4, ambv, berkerpeksag, erlend-aasland, gaogaotiantian, lysnikolaou, pablogsal, rhettinger, savannahostrowski and tomasr8 as code owners August 14, 2025 05:55
@bedevere-app bedevere-app Bot added the awaiting review label Aug 14, 2025
@bedevere-app bedevere-app Bot mentioned this pull request Aug 14, 2025
Add tests for command-line interface #131178
Open
7 of 9 tasks
@donbarbos
Fix test_unknown_flag for platform
9f3100d
picnixz
picnixz reviewed Aug 14, 2025
View reviewed changes

@picnixz picnixz left a comment

Copy link
Copy Markdown
Member

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
All reactions
  • 👍 1 reaction
donbarbos added 2 commits August 14, 2025 12:24
@donbarbos
Revert changes
0d289d4
@donbarbos
Revert missing regrtest
092a1c5
@donbarbos

donbarbos commented Aug 14, 2025

Copy link
Copy Markdown
Contributor Author

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

All reactions

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

@picnixz

picnixz commented Aug 14, 2025

Copy link
Copy Markdown
Member

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
All reactions
  • 👍 1 reaction

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

@donbarbos
Revert platform test fix
8a538cc
@inventshah

inventshah commented Aug 14, 2025

Copy link
Copy Markdown
Contributor

See #136632 for a previous discussion about changing tests to use the support.captured_* helpers.

All reactions

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

@serhiy-storchaka

serhiy-storchaka commented Aug 14, 2025

Copy link
Copy Markdown
Member

This is a code churn. Please leave it as is.

AA-Turner reacted with thumbs up emoji
All reactions
  • 👍 1 reaction

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

@AA-Turner AA-Turner closed this Aug 14, 2025
@donbarbos donbarbos mentioned this pull request Aug 16, 2025
gh-131178: Fix test_unknown_flag for platform CLI #137816
Merged
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Reviewers

@picnixz picnixz picnixz left review comments
@rhettinger rhettinger Awaiting requested review from rhettinger
@gaogaotiantian gaogaotiantian Awaiting requested review from gaogaotiantian
@berkerpeksag berkerpeksag Awaiting requested review from berkerpeksag
@erlend-aasland erlend-aasland Awaiting requested review from erlend-aasland
@Eclips4 Eclips4 Awaiting requested review from Eclips4 Eclips4 is a code owner
@tomasr8 tomasr8 Awaiting requested review from tomasr8 tomasr8 is a code owner
@pablogsal pablogsal Awaiting requested review from pablogsal pablogsal is a code owner
@lysnikolaou lysnikolaou Awaiting requested review from lysnikolaou lysnikolaou is a code owner
@ambv ambv Awaiting requested review from ambv
@savannahostrowski savannahostrowski Awaiting requested review from savannahostrowski

Uh oh!

There was an error while loading. Please reload this page.

Assignees

No one assigned

Labels

awaiting review

Projects

None yet

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.

5 participants

@donbarbos @picnixz @inventshah @serhiy-storchaka @AA-Turner
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.
You are visitor 01402520 — GeezerVison does not store the pages you look up.
Best viewed with Netscape Navigator 4.7 or Internet Explorer 6 at 800×600. No cookies required.