[PATCH 8 of 8 v2] tests: make test-pathencode use print_function
Pulkit Goyal
7895pulkit at gmail.com
Tue Apr 12 16:48:22 EDT 2016
# HG changeset patch
# User Pulkit Goyal <7895pulkit at gmail.com>
# Date 1460494066 -19800
# Wed Apr 13 02:17:46 2016 +0530
# Node ID 4085421ac8152395313235e2b865db63a95c046c
# Parent f158f711be055925ae6f4c5616ca43b9722e70ab
tests: make test-pathencode 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
@@ -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
#if py3exe
$ hg files 'set:(**.py)' | sed 's|\\|/|g' | xargs $PYTHON3 contrib/check-py3-compat.py
diff --git a/tests/test-pathencode.py b/tests/test-pathencode.py
--- a/tests/test-pathencode.py
+++ b/tests/test-pathencode.py
@@ -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: %s' % 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
More information about the Mercurial-devel
mailing list