[PATCH 11 of 11] py3: stabilize the output of lfs commandserver tests

Matt Harbison mharbison72 at gmail.com
Mon Jan 28 00:20:57 EST 2019


# HG changeset patch
# User Matt Harbison <matt_harbison at yahoo.com>
# Date 1548646329 18000
#      Sun Jan 27 22:32:09 2019 -0500
# Node ID cc7af840a1c33b22625e8dfa1e7b7edf64a04888
# Parent  9ee17fc21ed1a6ebf0c7180561f004f98a72c248
py3: stabilize the output of lfs commandserver tests

The print() statements were being output at the very end, so write to the same
stdout sink as runcommand, and explicitly flush.

diff --git a/tests/test-lfs-serve.t b/tests/test-lfs-serve.t
--- a/tests/test-lfs-serve.t
+++ b/tests/test-lfs-serve.t
@@ -359,12 +359,13 @@ lfs content, and the extension enabled.
   $ cp $HGRCPATH.orig $HGRCPATH
 
   >>> from __future__ import absolute_import
-  >>> from hgclient import check, readchannel, runcommand
+  >>> from hgclient import bprint, check, readchannel, runcommand, stdout
   >>> @check
   ... def checkflags(server):
   ...     readchannel(server)
-  ...     print('')
-  ...     print('# LFS required- both lfs and non-lfs revlogs have 0x2000 flag')
+  ...     bprint(b'')
+  ...     bprint(b'# LFS required- both lfs and non-lfs revlogs have 0x2000 flag')
+  ...     stdout.flush()
   ...     runcommand(server, [b'debugprocessors', b'lfs.bin', b'-R',
   ...                b'../server'])
   ...     runcommand(server, [b'debugprocessors', b'nonlfs2.txt', b'-R',
@@ -372,7 +373,8 @@ lfs content, and the extension enabled.
   ...     runcommand(server, [b'config', b'extensions', b'--cwd',
   ...                b'../server'])
   ... 
-  ...     print("\n# LFS not enabled- revlogs don't have 0x2000 flag")
+  ...     bprint(b"\n# LFS not enabled- revlogs don't have 0x2000 flag")
+  ...     stdout.flush()
   ...     runcommand(server, [b'debugprocessors', b'nonlfs3.txt'])
   ...     runcommand(server, [b'config', b'extensions'])
   
@@ -403,12 +405,13 @@ lfs content, and the extension enabled.
   > EOF
 
   >>> from __future__ import absolute_import, print_function
-  >>> from hgclient import check, readchannel, runcommand
+  >>> from hgclient import bprint, check, readchannel, runcommand, stdout
   >>> @check
   ... def checkflags2(server):
   ...     readchannel(server)
-  ...     print('')
-  ...     print('# LFS enabled- both lfs and non-lfs revlogs have 0x2000 flag')
+  ...     bprint(b'')
+  ...     bprint(b'# LFS enabled- both lfs and non-lfs revlogs have 0x2000 flag')
+  ...     stdout.flush()
   ...     runcommand(server, [b'debugprocessors', b'lfs.bin', b'-R',
   ...                b'../server'])
   ...     runcommand(server, [b'debugprocessors', b'nonlfs2.txt', b'-R',
@@ -416,11 +419,13 @@ lfs content, and the extension enabled.
   ...     runcommand(server, [b'config', b'extensions', b'--cwd',
   ...                b'../server'])
   ... 
-  ...     print('\n# LFS enabled without requirement- revlogs have 0x2000 flag')
+  ...     bprint(b'\n# LFS enabled without requirement- revlogs have 0x2000 flag')
+  ...     stdout.flush()
   ...     runcommand(server, [b'debugprocessors', b'nonlfs3.txt'])
   ...     runcommand(server, [b'config', b'extensions'])
   ... 
-  ...     print("\n# LFS disabled locally- revlogs don't have 0x2000 flag")
+  ...     bprint(b"\n# LFS disabled locally- revlogs don't have 0x2000 flag")
+  ...     stdout.flush()
   ...     runcommand(server, [b'debugprocessors', b'nonlfs.txt', b'-R',
   ...                b'../nonlfs'])
   ...     runcommand(server, [b'config', b'extensions', b'--cwd',


More information about the Mercurial-devel mailing list