comparison tests/test-stdio.py @ 45045:8403cc54bc83

procutil: make mercurial.utils.procutil.stderr unbuffered For most Mercurial code, it doesn’t make a difference, as the ui object flushes stderr explicitly (after the change, we could get rid of the explicit flush). One example where it makes a observable difference is mercurial.util.timed(). Without the patch, the time is not immediately shown on Python 3. With the patch, it’s shown immediately on all Python versions and platforms.
author Manuel Jacob <me@manueljacob.de>
date Sun, 05 Jul 2020 13:09:22 +0200
parents 359884685eab
children 8cd18aba5e6c
comparison
equal deleted inserted replaced
45044:359884685eab 45045:8403cc54bc83
98 # to use unbuffered stdout, but it's hard to do that. 98 # to use unbuffered stdout, but it's hard to do that.
99 test_stdout_ptys_unbuffered = unittest.expectedFailure( 99 test_stdout_ptys_unbuffered = unittest.expectedFailure(
100 test_stdout_ptys_unbuffered 100 test_stdout_ptys_unbuffered
101 ) 101 )
102 102
103 def test_stderr_pipes(self):
104 self._test('stderr', _pipes, UNBUFFERED)
105
106 def test_stderr_ptys(self):
107 self._test('stderr', _ptys, UNBUFFERED)
108
109 def test_stderr_pipes_unbuffered(self):
110 self._test('stderr', _pipes, UNBUFFERED, python_args=['-u'])
111
112 def test_stderr_ptys_unbuffered(self):
113 self._test('stderr', _ptys, UNBUFFERED, python_args=['-u'])
114
103 115
104 if __name__ == '__main__': 116 if __name__ == '__main__':
105 import silenttestrunner 117 import silenttestrunner
106 118
107 silenttestrunner.main(__name__) 119 silenttestrunner.main(__name__)