py3: suppress the return value from .write() call
authorPulkit Goyal <pulkit@yandex-team.ru>
Sat, 15 Sep 2018 00:01:52 +0300
changeset 39618 2f40bcebad30
parent 39617 c8e371ee65a4
child 39619 2aa12d7fcb4f
py3: suppress the return value from .write() call Differential Revision: https://phab.mercurial-scm.org/D4591
tests/test-convert-mtn.t
tests/test-diff-color.t
--- a/tests/test-convert-mtn.t	Sat Sep 15 00:01:20 2018 +0300
+++ b/tests/test-convert-mtn.t	Sat Sep 15 00:01:52 2018 +0300
@@ -43,7 +43,7 @@
   $ mkdir dir
   $ echo b > dir/b
   $ echo d > dir/d
-  $ $PYTHON -c 'open("bin", "wb").write(b"a\\x00b")'
+  $ $PYTHON -c 'open("bin", "wb").write(b"a\\x00b") and None'
   $ echo c > c
   $ mtn add a dir/b dir/d c bin
   mtn: adding 'a' to workspace manifest
@@ -65,7 +65,7 @@
   $ echo b >> dir/b
   $ mtn drop c
   mtn: dropping 'c' from workspace manifest
-  $ $PYTHON -c 'open("bin", "wb").write(b"b\\x00c")'
+  $ $PYTHON -c 'open("bin", "wb").write(b"b\\x00c") and None'
   $ mtn ci -m update1
   mtn: beginning commit on branch 'com.selenic.test'
   mtn: committed revision 51d0a982464573a2a2cf5ee2c9219c652aaebeff
@@ -218,7 +218,7 @@
 test large file support (> 32kB)
 
   >>> fp = open('large-file', 'wb')
-  >>> for x in range(10000): fp.write(b'%d\n' % x)
+  >>> for x in range(10000): fp.write(b'%d\n' % x) and None
   >>> fp.close()
   $ md5sum.py large-file
   5d6de8a95c3b6bf9e0ffb808ba5299c1  large-file
--- a/tests/test-diff-color.t	Sat Sep 15 00:01:20 2018 +0300
+++ b/tests/test-diff-color.t	Sat Sep 15 00:01:52 2018 +0300
@@ -57,7 +57,7 @@
   >>> with open('a', 'rb') as f:
   ...     data = f.read()
   >>> with open('a', 'wb') as f:
-  ...     f.write(data.replace(b'dd', b'dd \r'))
+  ...     f.write(data.replace(b'dd', b'dd \r')) and None
   $ hg diff --nodates
   \x1b[0;1mdiff -r cf9f4ba66af2 a\x1b[0m (esc)
   \x1b[0;31;1m--- a/a\x1b[0m (esc)