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.
This commit is contained in:
Yan Yanchii 2025-01-12 09:27:28 +01:00 committed by GitHub
parent 22a442181d
commit 30268b5d2f
No known key found for this signature in database
GPG key ID: B5690EEEBB952194

View file

@ -336,6 +336,8 @@ class CmdLineTest(unittest.TestCase):
self.assertEqual(stdout, expected)
self.assertEqual(p.returncode, 0)
@unittest.skipIf(os.environ.get("PYTHONUNBUFFERED", "0") != "0",
"Python stdio buffering is disabled.")
def test_non_interactive_output_buffering(self):
code = textwrap.dedent("""
import sys