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

login
register
mail settings
Submitter roby roby
Date April 4, 2016, 12:41 a.m.
Message ID <caaab696cd8a4f84a134.1459730465@roby>
Download mbox | patch
Permalink /patch/14308/
State Accepted
Headers show

Comments

roby roby - April 4, 2016, 12:41 a.m.
# HG changeset patch
# User Robert Stanca <robert.stanca7@gmail.com>
# Date 1459728248 -10800
#      Mon Apr 04 03:04:08 2016 +0300
# Node ID caaab696cd8a4f84a134a57c9cc67f9dacf8d148
# Parent  ba31f1b53bdad60b9e477a8704f08c0a417d8542
tests: use print_function in test-minirst.py

Patch

diff -r ba31f1b53bda -r caaab696cd8a tests/test-check-py3-compat.t
--- a/tests/test-check-py3-compat.t	Mon Apr 04 03:00:43 2016 +0300
+++ b/tests/test-check-py3-compat.t	Mon Apr 04 03:04:08 2016 +0300
@@ -60,7 +60,6 @@ 
   tests/test-lrucachedict.py not using absolute_import
   tests/test-lrucachedict.py requires print_function
   tests/test-manifest.py not using absolute_import
-  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
@@ -211,7 +210,6 @@ 
   tests/readlink.py: invalid syntax: invalid syntax (<unknown>, line *) (glob)
   tests/test-demandimport.py: invalid syntax: invalid syntax (<unknown>, line *) (glob)
   tests/test-lrucachedict.py: invalid syntax: invalid syntax (<unknown>, line *) (glob)
-  tests/test-minirst.py: invalid syntax: Missing parentheses in call to 'print' (<unknown>, line *) (glob)
   tests/test-parseindex*.py: invalid syntax: Missing parentheses in call to 'print' (<unknown>, line *) (glob)
   tests/test-propertycache.py: invalid syntax: Missing parentheses in call to 'print' (<unknown>, line *) (glob)
   tests/test-revlog-ancestry.py: invalid syntax: Missing parentheses in call to 'print' (<unknown>, line *) (glob)
diff -r ba31f1b53bda -r caaab696cd8a tests/test-minirst.py
--- a/tests/test-minirst.py	Mon Apr 04 03:00:43 2016 +0300
+++ b/tests/test-minirst.py	Mon Apr 04 03:04:08 2016 +0300
@@ -1,4 +1,4 @@ 
-from __future__ import absolute_import
+from __future__ import absolute_import, print_function
 from pprint import (
     pprint,
 )
@@ -8,24 +8,24 @@ 
 
 def debugformat(text, form, **kwargs):
     if form == 'html':
-        print "html format:"
+        print("html format:")
         out = minirst.format(text, style=form, **kwargs)
     else:
-        print "%d column format:" % form
+        print("%d column format:" % form)
         out = minirst.format(text, width=form, **kwargs)
 
-    print "-" * 70
+    print("-" * 70)
     if type(out) == tuple:
-        print out[0][:-1]
-        print "-" * 70
+        print(out[0][:-1])
+        print("-" * 70)
         pprint(out[1])
     else:
-        print out[:-1]
-    print "-" * 70
-    print
+        print(out[:-1])
+    print("-" * 70)
+    print()
 
 def debugformats(title, text, **kwargs):
-    print "== %s ==" % title
+    print("== %s ==" % title)
     debugformat(text, 60, **kwargs)
     debugformat(text, 30, **kwargs)
     debugformat(text, 'html', **kwargs)
@@ -246,7 +246,7 @@ 
 rst = minirst.maketable(data, 2, True)
 table = ''.join(rst)
 
-print table
+print(table)
 
 debugformats('table', table)
 
@@ -256,7 +256,7 @@ 
 rst = minirst.maketable(data, 1, False)
 table = ''.join(rst)
 
-print table
+print(table)
 
 debugformats('table+nl', table)