[PATCH]test-ancestor.py: use print_function

roby roby robert.stanca7 at gmail.com
Fri Mar 25 05:09:44 UTC 2016


# HG changeset patch
# User Robert Stanca <robert.stanca7 at gmail.com>
# Date 1458882514 -7200
#      Fri Mar 25 07:08:34 2016 +0200
# Node ID b4ded5849c3e6a571a1a5aa47f93f9f78e424f6d
# Parent  56b803ed2ae4bd2389f7e8e1ba8fc0290bf2531f
test-ancestor.py: use print_function

diff -r 56b803ed2ae4 -r b4ded5849c3e tests/test-ancestor.py
--- a/tests/test-ancestor.py    Fri Mar 25 07:03:09 2016 +0200
+++ b/tests/test-ancestor.py    Fri Mar 25 07:08:34 2016 +0200
@@ -1,4 +1,4 @@
-from __future__ import absolute_import
+from __future__ import absolute_import, print_function

 import binascii
 import getopt
@@ -96,11 +96,11 @@
         if nerrs[0] == 0:
             print >> sys.stderr, 'seed:', hex(seed)[:-1]
         if gerrs[0] == 0:
-            print >> sys.stderr, 'graph:', graph
-        print >> sys.stderr, '* bases:', bases
-        print >> sys.stderr, '* seq: ', seq
-        print >> sys.stderr, '*  output:  ', output
-        print >> sys.stderr, '*  expected:', expected
+            print ('graph:', graph, file=sys.stderr)
+        print ('* bases:', bases, file=sys.stderr)
+        print ('* seq: ', seq, file=sys.stderr)
+        print ('*  output:  ', output, file=sys.stderr)
+        print ('*  expected:', expected, file=sys.stderr)
         nerrs[0] += 1
         gerrs[0] += 1

@@ -184,8 +184,8 @@
                                   inclusive=inclusive)

 def printlazyancestors(s, l):
-    print 'membership: %r' % [n for n in l if n in s]
-    print 'iteration:  %r' % list(s)
+    print ('membership: %r' % [n for n in l if n in s])
+    print ('iteration:  %r' % list(s))

 def test_lazyancestors():
     # Empty revs
@@ -235,9 +235,9 @@
                 cgcas = sorted(cl.index.ancestors(a, b))
                 pygcas = sorted(ancestor.ancestors(cl.parentrevs, a, b))
                 if cgcas != pygcas:
-                    print "test_gca: for dag %s, gcas for %d, %d:" % (dag,
a, b)
-                    print "  C returned:      %s" % cgcas
-                    print "  Python returned: %s" % pygcas
+                    print ("test_gca: for dag %s, gcas for %d, %d:" %
(dag, a, b))
+                    print ("  C returned:      %s" % cgcas)
+                    print ("  Python returned: %s" % pygcas)

 def main():
     seed = None
diff -r 56b803ed2ae4 -r b4ded5849c3e tests/test-check-py3-compat.t
--- a/tests/test-check-py3-compat.t    Fri Mar 25 07:03:09 2016 +0200
+++ b/tests/test-check-py3-compat.t    Fri Mar 25 07:08:34 2016 +0200
@@ -59,7 +59,6 @@
   tests/sitecustomize.py not using absolute_import
   tests/svn-safe-append.py not using absolute_import
   tests/svnxml.py not using absolute_import
-  tests/test-ancestor.py requires print_function
   tests/test-atomictempfile.py not using absolute_import
   tests/test-batching.py not using absolute_import
   tests/test-batching.py requires print_function
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://www.mercurial-scm.org/pipermail/mercurial-devel/attachments/20160325/64c59b12/attachment.html>


More information about the Mercurial-devel mailing list