Mercurial > public > mercurial-scm > hg-stable
diff tests/test-stdio.py @ 45048: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 |
line wrap: on
line diff
--- a/tests/test-stdio.py Sun Jul 05 13:05:06 2020 +0200 +++ b/tests/test-stdio.py Sun Jul 05 13:09:22 2020 +0200 @@ -100,6 +100,18 @@ test_stdout_ptys_unbuffered ) + def test_stderr_pipes(self): + self._test('stderr', _pipes, UNBUFFERED) + + def test_stderr_ptys(self): + self._test('stderr', _ptys, UNBUFFERED) + + def test_stderr_pipes_unbuffered(self): + self._test('stderr', _pipes, UNBUFFERED, python_args=['-u']) + + def test_stderr_ptys_unbuffered(self): + self._test('stderr', _ptys, UNBUFFERED, python_args=['-u']) + if __name__ == '__main__': import silenttestrunner