Patchwork [6,of,6] py3: suppress the output from .write() calls in more tests

login
register
mail settings
Submitter Matt Harbison
Date Oct. 2, 2018, 4:30 a.m.
Message ID <2ffe81c1750140372380.1538454636@Envy>
Download mbox | patch
Permalink /patch/35286/
State Accepted
Headers show

Comments

Matt Harbison - Oct. 2, 2018, 4:30 a.m.
# HG changeset patch
# User Matt Harbison <matt_harbison@yahoo.com>
# Date 1538450784 14400
#      Mon Oct 01 23:26:24 2018 -0400
# Node ID 2ffe81c1750140372380c3477570c1a6b3d6dd4d
# Parent  07b0068e8153e7411553121f74eff157ee63e833
py3: suppress the output from .write() calls in more tests

I missed these in 803b7569c9ea because I forgot about `...` lines.

Patch

diff --git a/tests/test-commandserver.t b/tests/test-commandserver.t
--- a/tests/test-commandserver.t
+++ b/tests/test-commandserver.t
@@ -298,7 +298,7 @@  Clean hook cached version
   ... 
   ...     runcommand(server, ['bookmarks', 'bm3'])
   ...     f = open('a', 'ab')
-  ...     f.write('a\n')
+  ...     f.write('a\n') and None
   ...     f.close()
   ...     runcommand(server, ['commit', '-Amm'])
   ...     runcommand(server, ['bookmarks'])
@@ -391,7 +391,7 @@  Clean hook cached version
   ...     readchannel(server)
   ...     runcommand(server, ['commit', '-Am.'])
   ...     f = open('ignored-file', 'ab')
-  ...     f.write('')
+  ...     f.write('') and None
   ...     f.close()
   ...     f = open('.hgignore', 'ab')
   ...     f.write('ignored-file')
@@ -418,7 +418,7 @@  cache of non-public revisions should be 
   ...     for i in range(5, 7):
   ...         f = open('a', 'ab')
   ...         f.seek(0, os.SEEK_END)
-  ...         f.write('a\n')
+  ...         f.write('a\n') and None
   ...         f.close()
   ...         os.system('hg commit -Aqm%d' % i)
   ...     # new commits should be listed as draft revisions
@@ -463,7 +463,7 @@  cache of phase roots should be invalidat
   ...     # create new head, 5:731265503d86
   ...     runcommand(server, ['update', '-C', '0'])
   ...     f = open('a', 'ab')
-  ...     f.write('a\n')
+  ...     f.write('a\n') and None
   ...     f.close()
   ...     runcommand(server, ['commit', '-Am.', 'a'])
   ...     runcommand(server, ['log', '-Gq'])
diff --git a/tests/test-keyword.t b/tests/test-keyword.t
--- a/tests/test-keyword.t
+++ b/tests/test-keyword.t
@@ -217,7 +217,7 @@  hg status of kw-ignored binary file star
   >>> open("i", "wb").write("\1\nfoo") and None
   $ hg -q commit -Am metasep i
   $ hg status
-  >>> open("i", "wb").write("\1\nbar")
+  >>> open("i", "wb").write("\1\nbar") and None
   $ hg status
   M i
   $ hg -q commit -m "modify metasep" i
@@ -943,7 +943,7 @@  Imported patch should not be rejected
 
   >>> import re
   >>> text = re.sub(r'(Id.*)', r'\1 rejecttest', open('a').read())
-  >>> open('a', 'wb').write(text)
+  >>> open('a', 'wb').write(text) and None
   $ hg --debug commit -m'rejects?' -d '3 0' -u 'User Name <user@example.com>'
   committing files:
   a
diff --git a/tests/test-largefiles-wireproto.t b/tests/test-largefiles-wireproto.t
--- a/tests/test-largefiles-wireproto.t
+++ b/tests/test-largefiles-wireproto.t
@@ -243,7 +243,7 @@  Archive contains largefiles
   >>> import urllib2
   >>> u = 'http://localhost:%s/archive/default.zip' % os.environ['HGPORT2']
   >>> with open('archive.zip', 'w') as f:
-  ...     f.write(urllib2.urlopen(u).read())
+  ...     f.write(urllib2.urlopen(u).read()) and None
   $ unzip -t archive.zip
   Archive:  archive.zip
       testing: empty-default/.hg_archival.txt*OK (glob)
diff --git a/tests/test-lfs.t b/tests/test-lfs.t
--- a/tests/test-lfs.t
+++ b/tests/test-lfs.t
@@ -327,9 +327,9 @@  enabled adds the lfs requirement
   $ hg commit -m b
   $ hg status
   >>> with open('a2', 'wb') as f:
-  ...     f.write(b'\1\nSTART-WITH-HG-FILELOG-METADATA')
+  ...     f.write(b'\1\nSTART-WITH-HG-FILELOG-METADATA') and None
   >>> with open('a1', 'wb') as f:
-  ...     f.write(b'\1\nMETA\n')
+  ...     f.write(b'\1\nMETA\n') and None
   $ hg commit -m meta
   $ hg status
   $ hg log -T '{rev}: {file_copies} | {file_dels} | {file_adds}\n'