[PATCH 1 of 8 v2] tests: make test-wireproto use print_function

Pulkit Goyal 7895pulkit at gmail.com
Tue Mar 29 07:47:45 EDT 2016


# HG changeset patch
# User Pulkit Goyal <7895pulkit at gmail.com>
# Date 1459248298 -19800
#      Tue Mar 29 16:14:58 2016 +0530
# Node ID a7f4e415dc0d2a27ceb715245866759cd7ed5999
# Parent  0e330d7d9f53fc37cbeee8d1389a06465eca2241
tests: make test-wireproto use print_function

diff --git a/tests/test-check-py3-compat.t b/tests/test-check-py3-compat.t
--- a/tests/test-check-py3-compat.t
+++ b/tests/test-check-py3-compat.t
@@ -116,7 +116,6 @@
   tests/test-url.py not using absolute_import
   tests/test-url.py requires print_function
   tests/test-walkrepo.py requires print_function
-  tests/test-wireproto.py requires print_function
 
 #if py3exe
   $ hg files 'set:(**.py)' | sed 's|\\|/|g' | xargs $PYTHON3 contrib/check-py3-compat.py
@@ -301,6 +300,5 @@
   tests/test-ui-config.py: invalid syntax: invalid syntax (<unknown>, line *) (glob)
   tests/test-ui-verbosity.py: invalid syntax: Missing parentheses in call to 'print' (<unknown>, line *) (glob)
   tests/test-walkrepo.py: invalid syntax: invalid syntax (<unknown>, line *) (glob)
-  tests/test-wireproto.py: invalid syntax: invalid syntax (<unknown>, line *) (glob)
 
 #endif
diff --git a/tests/test-wireproto.py b/tests/test-wireproto.py
--- a/tests/test-wireproto.py
+++ b/tests/test-wireproto.py
@@ -1,4 +1,4 @@
-from __future__ import absolute_import
+from __future__ import absolute_import, print_function
 
 import StringIO
 
@@ -52,8 +52,8 @@
 srv = serverrepo()
 clt = clientpeer(srv)
 
-print clt.greet("Foobar")
+print(clt.greet("Foobar"))
 b = clt.batch()
 fs = [b.greet(s) for s in ["Fo, =;:<o", "Bar"]]
 b.submit()
-print [f.value for f in fs]
+print([f.value for f in fs])


More information about the Mercurial-devel mailing list