Skip to content

gh-131178: Use support.captured_stdout and support.captured_stderr #137748

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

Closed

Conversation

donBarbos
Copy link
Contributor

@donBarbos donBarbos commented Aug 14, 2025

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

Copy link
Member

@picnixz picnixz left a 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

@donBarbos
Copy link
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

@picnixz
Copy link
Member

picnixz commented Aug 14, 2025

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.

@inventshah
Copy link
Contributor

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

@serhiy-storchaka
Copy link
Member

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

@AA-Turner AA-Turner closed this Aug 14, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

5 participants