diff options
author | Serhiy Storchaka <storchaka@gmail.com> | 2017-10-04 17:25:40 (GMT) |
---|---|---|
committer | GitHub <noreply@github.com> | 2017-10-04 17:25:40 (GMT) |
commit | 77732be801c18013cfbc86e27fcc50194ca22c8e (patch) | |
tree | 994379199522db4d759f5759655ad0c466e7fdab /Lib/test | |
parent | 0b5e61ddca73ad4fe597fb15065115b0285c8849 (diff) | |
download | cpython-77732be801c18013cfbc86e27fcc50194ca22c8e.zip cpython-77732be801c18013cfbc86e27fcc50194ca22c8e.tar.gz cpython-77732be801c18013cfbc86e27fcc50194ca22c8e.tar.bz2 |
bpo-30404: The -u option now makes the stdout and stderr streams totally unbuffered. (#1667)
Diffstat (limited to 'Lib/test')
-rw-r--r-- | Lib/test/test_cmd_line.py | 7 |
1 files changed, 3 insertions, 4 deletions
diff --git a/Lib/test/test_cmd_line.py b/Lib/test/test_cmd_line.py index 3e20427..28ddb2b 100644 --- a/Lib/test/test_cmd_line.py +++ b/Lib/test/test_cmd_line.py @@ -221,13 +221,12 @@ class CmdLineTest(unittest.TestCase): rc, out, err = assert_python_ok('-u', '-c', code) data = err if stream == 'stderr' else out self.assertEqual(data, b'x', "binary %s not unbuffered" % stream) - # Text is line-buffered - code = ("import os, sys; sys.%s.write('x\\n'); os._exit(0)" + # Text is unbuffered + code = ("import os, sys; sys.%s.write('x'); os._exit(0)" % stream) rc, out, err = assert_python_ok('-u', '-c', code) data = err if stream == 'stderr' else out - self.assertEqual(data.strip(), b'x', - "text %s not line-buffered" % stream) + self.assertEqual(data, b'x', "text %s not unbuffered" % stream) def test_unbuffered_input(self): # sys.stdin still works with '-u' |