py3: use print_function in test-minirst.py
authorRobert Stanca <robert.stanca7@gmail.com>
Mon, 04 Apr 2016 03:04:08 +0300
changeset 28752 6b2f9a4e2f97
parent 28751 67a4e42a651f
child 28753 0c2295384eea
py3: use print_function in test-minirst.py
tests/test-check-py3-compat.t
tests/test-minirst.py
--- 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
@@ -236,7 +235,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)
--- 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)