Patchwork [3,of,6,V2] tests: use print_function in test-duplicateoptions.py

login
register
mail settings
Submitter roby roby
Date April 3, 2016, 2:30 p.m.
Message ID <1b722b83c621472dced8.1459693832@roby>
Download mbox | patch
Permalink /patch/14286/
State Accepted
Headers show

Comments

roby roby - April 3, 2016, 2:30 p.m.
# HG changeset patch
# User Robert Stanca <robert.stanca7@gmail.com>
# Date 1459691923 -10800
#      Sun Apr 03 16:58:43 2016 +0300
# Node ID 1b722b83c621472dced8f40e0c2c638ae8effb67
# Parent  4658e3f3afc977df473cf27e3ea021ccd1548ffd
tests: use print_function in test-duplicateoptions.py

Patch

diff -r 4658e3f3afc9 -r 1b722b83c621 tests/test-check-py3-compat.t
--- a/tests/test-check-py3-compat.t	Sun Apr 03 16:56:15 2016 +0300
+++ b/tests/test-check-py3-compat.t	Sun Apr 03 16:58:43 2016 +0300
@@ -56,7 +56,6 @@ 
   tests/test-demandimport.py not using absolute_import
   tests/test-demandimport.py requires print_function
   tests/test-doctest.py not using absolute_import
-  tests/test-duplicateoptions.py requires print_function
   tests/test-filecache.py not using absolute_import
   tests/test-filecache.py requires print_function
   tests/test-filelog.py not using absolute_import
@@ -222,7 +221,6 @@ 
   mercurial/wireproto.py: error importing module: <SyntaxError> invalid syntax (bundle*.py, line *) (line *) (glob)
   tests/readlink.py: invalid syntax: invalid syntax (<unknown>, line *) (glob)
   tests/test-demandimport.py: invalid syntax: invalid syntax (<unknown>, line *) (glob)
-  tests/test-duplicateoptions.py: invalid syntax: invalid syntax (<unknown>, line *) (glob)
   tests/test-filecache.py: invalid syntax: Missing parentheses in call to 'print' (<unknown>, line *) (glob)
   tests/test-filelog.py: invalid syntax: Missing parentheses in call to 'print' (<unknown>, line *) (glob)
   tests/test-hg-parseurl.py: invalid syntax: invalid syntax (<unknown>, line *) (glob)
diff -r 4658e3f3afc9 -r 1b722b83c621 tests/test-duplicateoptions.py
--- a/tests/test-duplicateoptions.py	Sun Apr 03 16:56:15 2016 +0300
+++ b/tests/test-duplicateoptions.py	Sun Apr 03 16:58:43 2016 +0300
@@ -1,4 +1,4 @@ 
-from __future__ import absolute_import
+from __future__ import absolute_import, print_function
 import os
 from mercurial import (
     commands,
@@ -36,6 +36,6 @@ 
     for option in entry[1]:
         if (option[0] and option[0] in seenshort) or \
            (option[1] and option[1] in seenlong):
-            print "command '" + cmd + "' has duplicate option " + str(option)
+            print("command '" + cmd + "' has duplicate option " + str(option))
         seenshort.add(option[0])
         seenlong.add(option[1])