##// END OF EJS Templates
py3: use print_function in test-minirst.py
Robert Stanca -
r28752:6b2f9a4e default
parent child Browse files
Show More
@@ -60,7 +60,6 b''
60 tests/test-lrucachedict.py not using absolute_import
60 tests/test-lrucachedict.py not using absolute_import
61 tests/test-lrucachedict.py requires print_function
61 tests/test-lrucachedict.py requires print_function
62 tests/test-manifest.py not using absolute_import
62 tests/test-manifest.py not using absolute_import
63 tests/test-minirst.py requires print_function
64 tests/test-parseindex2.py not using absolute_import
63 tests/test-parseindex2.py not using absolute_import
65 tests/test-parseindex2.py requires print_function
64 tests/test-parseindex2.py requires print_function
66 tests/test-pathencode.py not using absolute_import
65 tests/test-pathencode.py not using absolute_import
@@ -236,7 +235,6 b''
236 tests/readlink.py: invalid syntax: invalid syntax (<unknown>, line *) (glob)
235 tests/readlink.py: invalid syntax: invalid syntax (<unknown>, line *) (glob)
237 tests/test-demandimport.py: invalid syntax: invalid syntax (<unknown>, line *) (glob)
236 tests/test-demandimport.py: invalid syntax: invalid syntax (<unknown>, line *) (glob)
238 tests/test-lrucachedict.py: invalid syntax: invalid syntax (<unknown>, line *) (glob)
237 tests/test-lrucachedict.py: invalid syntax: invalid syntax (<unknown>, line *) (glob)
239 tests/test-minirst.py: invalid syntax: Missing parentheses in call to 'print' (<unknown>, line *) (glob)
240 tests/test-parseindex*.py: invalid syntax: Missing parentheses in call to 'print' (<unknown>, line *) (glob)
238 tests/test-parseindex*.py: invalid syntax: Missing parentheses in call to 'print' (<unknown>, line *) (glob)
241 tests/test-propertycache.py: invalid syntax: Missing parentheses in call to 'print' (<unknown>, line *) (glob)
239 tests/test-propertycache.py: invalid syntax: Missing parentheses in call to 'print' (<unknown>, line *) (glob)
242 tests/test-revlog-ancestry.py: invalid syntax: Missing parentheses in call to 'print' (<unknown>, line *) (glob)
240 tests/test-revlog-ancestry.py: invalid syntax: Missing parentheses in call to 'print' (<unknown>, line *) (glob)
@@ -1,4 +1,4 b''
1 from __future__ import absolute_import
1 from __future__ import absolute_import, print_function
2 from pprint import (
2 from pprint import (
3 pprint,
3 pprint,
4 )
4 )
@@ -8,24 +8,24 b' from mercurial import ('
8
8
9 def debugformat(text, form, **kwargs):
9 def debugformat(text, form, **kwargs):
10 if form == 'html':
10 if form == 'html':
11 print "html format:"
11 print("html format:")
12 out = minirst.format(text, style=form, **kwargs)
12 out = minirst.format(text, style=form, **kwargs)
13 else:
13 else:
14 print "%d column format:" % form
14 print("%d column format:" % form)
15 out = minirst.format(text, width=form, **kwargs)
15 out = minirst.format(text, width=form, **kwargs)
16
16
17 print "-" * 70
17 print("-" * 70)
18 if type(out) == tuple:
18 if type(out) == tuple:
19 print out[0][:-1]
19 print(out[0][:-1])
20 print "-" * 70
20 print("-" * 70)
21 pprint(out[1])
21 pprint(out[1])
22 else:
22 else:
23 print out[:-1]
23 print(out[:-1])
24 print "-" * 70
24 print("-" * 70)
25 print
25 print()
26
26
27 def debugformats(title, text, **kwargs):
27 def debugformats(title, text, **kwargs):
28 print "== %s ==" % title
28 print("== %s ==" % title)
29 debugformat(text, 60, **kwargs)
29 debugformat(text, 60, **kwargs)
30 debugformat(text, 30, **kwargs)
30 debugformat(text, 30, **kwargs)
31 debugformat(text, 'html', **kwargs)
31 debugformat(text, 'html', **kwargs)
@@ -246,7 +246,7 b" data = [['a', 'b', 'c'],"
246 rst = minirst.maketable(data, 2, True)
246 rst = minirst.maketable(data, 2, True)
247 table = ''.join(rst)
247 table = ''.join(rst)
248
248
249 print table
249 print(table)
250
250
251 debugformats('table', table)
251 debugformats('table', table)
252
252
@@ -256,7 +256,7 b" data = [['s', 'long', 'line\\ngoes on her"
256 rst = minirst.maketable(data, 1, False)
256 rst = minirst.maketable(data, 1, False)
257 table = ''.join(rst)
257 table = ''.join(rst)
258
258
259 print table
259 print(table)
260
260
261 debugformats('table+nl', table)
261 debugformats('table+nl', table)
262
262
General Comments 0
You need to be logged in to leave comments. Login now