Mercurial > hg
comparison tests/test-stdio.py @ 45043:be58fb1eaa73
procutil: make stdout line-buffered on Windows if connected to TTY
Windows doesn’t support line buffering. Previously, we worked around that by
setting the stream unbuffered. Instead, we can use our own line buffering we
already use on Python 3.
author | Manuel Jacob <me@manueljacob.de> |
---|---|
date | Sat, 04 Jul 2020 11:41:39 +0200 |
parents | c7d109c400a4 |
children | 359884685eab |
comparison
equal
deleted
inserted
replaced
45042:c88577199023 | 45043:be58fb1eaa73 |
---|---|
87 self._test(_pipes, UNBUFFERED, python_args=['-u']) | 87 self._test(_pipes, UNBUFFERED, python_args=['-u']) |
88 | 88 |
89 def test_stdout_ptys_unbuffered(self): | 89 def test_stdout_ptys_unbuffered(self): |
90 self._test(_ptys, UNBUFFERED, python_args=['-u']) | 90 self._test(_ptys, UNBUFFERED, python_args=['-u']) |
91 | 91 |
92 # On Windows, test_stdout_ptys wouldn't pass, but it's skipped anyway. | |
93 if not pycompat.ispy3 and not pycompat.iswindows: | 92 if not pycompat.ispy3 and not pycompat.iswindows: |
94 # On Python 2 on non-Windows, we manually open stdout in line-buffered | 93 # On Python 2 on non-Windows, we manually open stdout in line-buffered |
95 # mode if connected to a TTY. We should check if Python was configured | 94 # mode if connected to a TTY. We should check if Python was configured |
96 # to use unbuffered stdout, but it's hard to do that. | 95 # to use unbuffered stdout, but it's hard to do that. |
97 test_stdout_ptys_unbuffered = unittest.expectedFailure( | 96 test_stdout_ptys_unbuffered = unittest.expectedFailure( |