-
-
Notifications
You must be signed in to change notification settings - Fork 30.9k
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
gh-128377: Fix test_cmd_line.test_non_interactive_output_buffering
fail with PYTHONUNBUFFERED=1
#128378
base: main
Are you sure you want to change the base?
Conversation
2bd00e0
to
51a2015
Compare
…PYTHONUNBUFFERED=1`
51a2015
to
565f15c
Compare
test_cmd_line
fail with PYTHONUNBUFFERED=1
test_cmd_line.test_non_interactive_output_buffering
fail with PYTHONUNBUFFERED=1
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.
We should use os_helper.EnvironmentVarGuard()
instead of manually messing with os.environ
.
Thanks for this one. I didn't know whether we had something like that somewhere but you found what I wanted to emulate with |
@ZeroIntensity thanks for pointing to that |
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.
LGTM (for reviewers, it's easier to hide whitespace changes).
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.
This works, but feels kind of hacky. Why not just unittest.skipIf(os.environ.get("PYTHONUNBUFFERED"))
? (Also I'd like to hear @picnixz's preference.)
Now that you're raising this issue, I'd actually prefer skipping it. If the test is broken when you use So yes, let's just skip the test. |
Sorry linter failed, did not have pre-commit hooks installed. Will fix asap |
Thanks. I'll merge this one tomorrow (I'll write a nice commit message). |
Having fun with your commit privileges already I see 😄 |
test_cmd_line.test_non_interactive_output_buffering
fails whenPYTHONUNBUFFERED
is enabled #128377