Patchwork [4,of,7] py3: suppress write() result and close file in test-bookmarks-pushpull.t

login
register
mail settings
Submitter Yuya Nishihara
Date July 9, 2018, 1:24 p.m.
Message ID <ad368dee20a7762100e5.1531142674@mimosa>
Download mbox | patch
Permalink /patch/32702/
State Accepted
Headers show

Comments

Yuya Nishihara - July 9, 2018, 1:24 p.m.
# HG changeset patch
# User Yuya Nishihara <yuya@tcha.org>
# Date 1531044714 -32400
#      Sun Jul 08 19:11:54 2018 +0900
# Node ID ad368dee20a7762100e5c46e152e67d838e15d9b
# Parent  6737fa60496004cfb6a9bc1bbc1e212321c97591
py3: suppress write() result and close file in test-bookmarks-pushpull.t

Patch

diff --git a/contrib/python3-whitelist b/contrib/python3-whitelist
--- a/contrib/python3-whitelist
+++ b/contrib/python3-whitelist
@@ -24,6 +24,7 @@  test-bisect3.t
 test-blackbox.t
 test-bookmarks-current.t
 test-bookmarks-merge.t
+test-bookmarks-pushpull.t
 test-bookmarks-rebase.t
 test-bookmarks-strip.t
 test-bookmarks.t
diff --git a/tests/test-bookmarks-pushpull.t b/tests/test-bookmarks-pushpull.t
--- a/tests/test-bookmarks-pushpull.t
+++ b/tests/test-bookmarks-pushpull.t
@@ -1034,7 +1034,8 @@  Pushing a really long bookmark should wo
 ===============================================
 
 #if b2-binary
-  >>> open('longname', 'w').write('wat' * 100)
+  >>> with open('longname', 'w') as f:
+  ...     f.write('wat' * 100) and None
   $ hg book `cat longname`
   $ hg push -B `cat longname` ../unchanged-b
   pushing to ../unchanged-b