[PATCH]test-pathencode.py: use absolute_import and print_function

roby roby robert.stanca7 at gmail.com
Fri Mar 25 04:41:01 UTC 2016


# HG changeset patch
# User Robert Stanca <robert.stanca7 at gmail.com>
# Date 1458880702 -7200
#      Fri Mar 25 06:38:22 2016 +0200
# Node ID 74f05a74d05659132bf4c0000bd3e0bb0ad57e8e
# Parent  1a1e4350b560cf2f49fe235d2e5168471877462d
test-pathencode.py: use absolute_import and print_function

diff -r 1a1e4350b560 -r 74f05a74d056 tests/test-check-py3-compat.t
--- a/tests/test-check-py3-compat.t    Thu Mar 24 00:09:58 2016 -0700
+++ b/tests/test-check-py3-compat.t    Fri Mar 25 06:38:22 2016 +0200
@@ -94,8 +94,6 @@
   tests/test-minirst.py requires print_function
   tests/test-parseindex2.py not using absolute_import
   tests/test-parseindex2.py requires print_function
-  tests/test-pathencode.py not using absolute_import
-  tests/test-pathencode.py requires print_function
   tests/test-propertycache.py not using absolute_import
   tests/test-propertycache.py requires print_function
   tests/test-revlog-ancestry.py not using absolute_import
diff -r 1a1e4350b560 -r 74f05a74d056 tests/test-pathencode.py
--- a/tests/test-pathencode.py    Thu Mar 24 00:09:58 2016 -0700
+++ b/tests/test-pathencode.py    Fri Mar 25 06:38:22 2016 +0200
@@ -5,9 +5,17 @@
 # that have proven likely to expose bugs and divergent behavior in
 # different encoding implementations.

+from __future__ import absolute_import
 from mercurial import store
-import binascii, itertools, math, os, random, sys, time
+import binascii
 import collections
+import itertools
+import math
+import os
+import random
+import sys
+import time
+

 validchars = set(map(chr, range(0, 256)))
 alphanum = range(ord('A'), ord('Z'))
@@ -154,10 +162,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
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://www.mercurial-scm.org/pipermail/mercurial-devel/attachments/20160325/e883ba80/attachment.html>


More information about the Mercurial-devel mailing list