Skip to content

Commit 30268b5

Browse files
authored
gh-128377: Skip test_cmd_line.test_non_interactive_output_buffering when PYTHONUNBUFFERED=1 (#128378)
The `test_cmd_line.test_non_interactive_output_buffering` test assumes a buffered `stdio` without checking the `PYTHONUNBUFFERED` value. Instead of changing the environment variable for the duration of the test, it is better to simply skip it.
1 parent 22a4421 commit 30268b5

File tree

1 file changed

+2
-0
lines changed

1 file changed

+2
-0
lines changed

Lib/test/test_cmd_line.py

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -336,6 +336,8 @@ def test_osx_android_utf8(self):
336336
self.assertEqual(stdout, expected)
337337
self.assertEqual(p.returncode, 0)
338338

339+
@unittest.skipIf(os.environ.get("PYTHONUNBUFFERED", "0") != "0",
340+
"Python stdio buffering is disabled.")
339341
def test_non_interactive_output_buffering(self):
340342
code = textwrap.dedent("""
341343
import sys

0 commit comments

Comments
 (0)