py3: suppress the return value of write() in tests/test-subrepo-missing.t
authorPulkit Goyal <7895pulkit@gmail.com>
Thu, 12 Apr 2018 08:06:39 -0700
changeset 37584 fd0e6678ba0f
parent 37583 6939b6ac960a
child 37585 df4fd29c0854
py3: suppress the return value of write() in tests/test-subrepo-missing.t write() on Python 3 returns a value whereas does not return anything on Python 2. So we need to supress the value. Differential Revision: https://phab.mercurial-scm.org/D3283
tests/test-subrepo-missing.t
--- a/tests/test-subrepo-missing.t	Thu Apr 12 16:52:32 2018 +0530
+++ b/tests/test-subrepo-missing.t	Thu Apr 12 08:06:39 2018 -0700
@@ -14,7 +14,7 @@
 
 ignore blanklines in .hgsubstate
 
-  >>> open('.hgsubstate', 'wb').write(b'\n\n   \t \n   \n')
+  >>> open('.hgsubstate', 'wb').write(b'\n\n   \t \n   \n') and None
   $ hg st --subrepos
   M .hgsubstate
   $ hg revert -qC .hgsubstate
@@ -22,7 +22,7 @@
 abort more gracefully on .hgsubstate parsing error
 
   $ cp .hgsubstate .hgsubstate.old
-  >>> open('.hgsubstate', 'wb').write(b'\ninvalid')
+  >>> open('.hgsubstate', 'wb').write(b'\ninvalid') and None
   $ hg st --subrepos --cwd $TESTTMP -R $TESTTMP/repo
   abort: invalid subrepository revision specifier in 'repo/.hgsubstate' line 2
   [255]