changeset 28918:72f683260f31

tests: make test-pathencode use print_function
author Pulkit Goyal <7895pulkit@gmail.com>
date Thu, 14 Apr 2016 01:06:45 +0530
parents f798ffe7cb08
children a94f34306bb9
files tests/test-check-py3-compat.t tests/test-pathencode.py
diffstat 2 files changed, 6 insertions(+), 5 deletions(-) [+]
line wrap: on
line diff
--- a/tests/test-check-py3-compat.t	Thu Apr 14 01:03:24 2016 +0530
+++ b/tests/test-check-py3-compat.t	Thu Apr 14 01:06:45 2016 +0530
@@ -61,7 +61,6 @@
   tests/test-lrucachedict.py requires print_function
   tests/test-manifest.py not using absolute_import
   tests/test-pathencode.py not using absolute_import
-  tests/test-pathencode.py requires print_function
   tests/test-simplemerge.py not using absolute_import
   tests/test-trusted.py requires print_function
 
--- a/tests/test-pathencode.py	Thu Apr 14 01:03:24 2016 +0530
+++ b/tests/test-pathencode.py	Thu Apr 14 01:06:45 2016 +0530
@@ -5,6 +5,8 @@
 # that have proven likely to expose bugs and divergent behavior in
 # different encoding implementations.
 
+from __future__ import print_function
+
 from mercurial import store
 import binascii, itertools, math, os, random, sys, time
 import collections
@@ -154,10 +156,10 @@
         r = store._hybridencode(p, True) # reference implementation in Python
         if h != r:
             if nerrs == 0:
-                print >> sys.stderr, 'seed:', hex(seed)[:-1]
-            print >> sys.stderr, "\np: '%s'" % p.encode("string_escape")
-            print >> sys.stderr, "h: '%s'" % h.encode("string_escape")
-            print >> sys.stderr, "r: '%s'" % r.encode("string_escape")
+                print('seed:', hex(seed)[:-1], file=sys.stderr)
+            print("\np: '%s'" % p.encode("string_escape"), file=sys.stderr)
+            print("h: '%s'" % h.encode("string_escape"), file=sys.stderr)
+            print("r: '%s'" % r.encode("string_escape"), file=sys.stderr)
             nerrs += 1
     return nerrs