diff --git a/contrib/python3-whitelist b/contrib/python3-whitelist --- a/contrib/python3-whitelist +++ b/contrib/python3-whitelist @@ -105,6 +105,7 @@ test-directaccess.t test-dirstate-backup.t test-dirstate-nonnormalset.t test-dirstate.t +test-dispatch.py test-doctest.py test-double-merge.t test-drawdag.t diff --git a/tests/test-dispatch.py b/tests/test-dispatch.py --- a/tests/test-dispatch.py +++ b/tests/test-dispatch.py @@ -1,18 +1,24 @@ from __future__ import absolute_import, print_function import os +import sys from mercurial import ( dispatch, ) +def printb(data, end=b'\n'): + out = getattr(sys.stdout, 'buffer', sys.stdout) + out.write(data + end) + out.flush() + def testdispatch(cmd): """Simple wrapper around dispatch.dispatch() Prints command and result value, but does not handle quoting. """ - print(b"running: %s" % (cmd,)) + printb(b"running: %s" % (cmd,)) req = dispatch.request(cmd.split()) result = dispatch.dispatch(req) - print(b"result: %r" % (result,)) + printb(b"result: %r" % (result,)) testdispatch(b"init test1") os.chdir('test1')