# HG changeset patch # User Robert Stanca # Date 2016-04-03 03:16:17 # Node ID 4e51f9d1683ec34d7f6377d354ac0eab6b154a14 # Parent 2e54aaa65afc5cb66101ac63e3d40191ac028b4e py3: use print_function in test-bdiff.py diff --git a/tests/test-bdiff.py b/tests/test-bdiff.py --- a/tests/test-bdiff.py +++ b/tests/test-bdiff.py @@ -1,4 +1,4 @@ -from __future__ import absolute_import +from __future__ import absolute_import, print_function import struct from mercurial import ( bdiff, @@ -11,13 +11,13 @@ def test1(a, b): if d: c = mpatch.patches(a, [d]) if c != b: - print "***", repr(a), repr(b) - print "bad:" - print repr(c)[:200] - print repr(d) + print("***", repr(a), repr(b)) + print("bad:") + print(repr(c)[:200]) + print(repr(d)) def test(a, b): - print "***", repr(a), repr(b) + print("***", repr(a), repr(b)) test1(a, b) test1(b, a) @@ -48,23 +48,23 @@ def showdiff(a, b): while pos < len(bin): p1, p2, l = struct.unpack(">lll", bin[pos:pos + 12]) pos += 12 - print p1, p2, repr(bin[pos:pos + l]) + print(p1, p2, repr(bin[pos:pos + l])) pos += l showdiff("x\n\nx\n\nx\n\nx\n\nz\n", "x\n\nx\n\ny\n\nx\n\nx\n\nz\n") showdiff("x\n\nx\n\nx\n\nx\n\nz\n", "x\n\nx\n\ny\n\nx\n\ny\n\nx\n\nz\n") -print "done" +print("done") def testfixws(a, b, allws): c = bdiff.fixws(a, allws) if c != b: - print "*** fixws", repr(a), repr(b), allws - print "got:" - print repr(c) + print("*** fixws", repr(a), repr(b), allws) + print("got:") + print(repr(c)) testfixws(" \ta\r b\t\n", "ab\n", 1) testfixws(" \ta\r b\t\n", " a b\n", 0) testfixws("", "", 1) testfixws("", "", 0) -print "done" +print("done") 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 @@ -53,7 +53,6 @@ tests/svn-safe-append.py not using absolute_import tests/svnxml.py not using absolute_import tests/test-atomictempfile.py not using absolute_import - tests/test-bdiff.py requires print_function tests/test-context.py not using absolute_import tests/test-context.py requires print_function tests/test-demandimport.py not using absolute_import @@ -250,7 +249,6 @@ mercurial/windows.py: error importing module: No module named '_winreg' (line *) (glob) mercurial/wireproto.py: error importing module: invalid syntax (bundle*.py, line *) (line *) (glob) tests/readlink.py: invalid syntax: invalid syntax (, line *) (glob) - tests/test-bdiff.py: invalid syntax: invalid syntax (, line *) (glob) tests/test-context.py: invalid syntax: invalid syntax (, line *) (glob) tests/test-demandimport.py: invalid syntax: invalid syntax (, line *) (glob) tests/test-duplicateoptions.py: invalid syntax: invalid syntax (, line *) (glob)