py3: stabilize the output of lfs commandserver tests
authorMatt Harbison <matt_harbison@yahoo.com>
Sun, 27 Jan 2019 22:32:09 -0500
changeset 41433 3757a968d63a
parent 41432 080a5c83914f
child 41434 48394923fbdc
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.
tests/test-lfs-serve.t
--- a/tests/test-lfs-serve.t	Sun Jan 27 20:58:18 2019 -0500
+++ b/tests/test-lfs-serve.t	Sun Jan 27 22:32:09 2019 -0500
@@ -359,12 +359,13 @@
   $ 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 @@
   ...     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 @@
   > 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 @@
   ...     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',