summaryrefslogtreecommitdiff
path: root/Lib/test/test_cmd_line.py
diff options
context:
space:
mode:
authorSerhiy Storchaka <storchaka@gmail.com>2017-10-04 20:25:40 +0300
committerGitHub <noreply@github.com>2017-10-04 20:25:40 +0300
commit77732be801c18013cfbc86e27fcc50194ca22c8e (patch)
tree994379199522db4d759f5759655ad0c466e7fdab /Lib/test/test_cmd_line.py
parent0b5e61ddca73ad4fe597fb15065115b0285c8849 (diff)
downloadcpython-git-77732be801c18013cfbc86e27fcc50194ca22c8e.tar.gz
bpo-30404: The -u option now makes the stdout and stderr streams totally unbuffered. (#1667)
Diffstat (limited to 'Lib/test/test_cmd_line.py')
-rw-r--r--Lib/test/test_cmd_line.py7
1 files changed, 3 insertions, 4 deletions
diff --git a/Lib/test/test_cmd_line.py b/Lib/test/test_cmd_line.py
index 3e20427917..28ddb2ba1b 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'