gh-128377: Fix test_cmd_line.test_non_interactive_output_buffering fail with PYTHONUNBUFFERED=1 - #128378
Conversation
2bd00e0 to
51a2015
Compare
…PYTHONUNBUFFERED=1`
51a2015 to
565f15c
Compare
test_cmd_line fail with PYTHONUNBUFFERED=1test_cmd_line.test_non_interactive_output_buffering fail with PYTHONUNBUFFERED=1
ZeroIntensity
left a comment
There was a problem hiding this comment.
We should use os_helper.EnvironmentVarGuard() instead of manually messing with os.environ.
|
@ZeroIntensity thanks for pointing to that |
picnixz
left a comment
There was a problem hiding this comment.
LGTM (for reviewers, it's easier to hide whitespace changes).
ZeroIntensity
left a comment
There was a problem hiding this comment.
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 😄 |
|
Thank you for the fix and the reviews! |

test_cmd_line.test_non_interactive_output_bufferingfails whenPYTHONUNBUFFEREDis enabled #128377