##// END OF EJS Templates
py3: use print_function in test-ancestor.py
Robert Stanca -
r28723:18e73803 default
parent child Browse files
Show More
@@ -1,4 +1,4 b''
1 from __future__ import absolute_import
1 from __future__ import absolute_import, print_function
2
2
3 import binascii
3 import binascii
4 import getopt
4 import getopt
@@ -94,13 +94,13 b' def test_missingancestors(seed, rng):'
94
94
95 def err(seed, graph, bases, seq, output, expected):
95 def err(seed, graph, bases, seq, output, expected):
96 if nerrs[0] == 0:
96 if nerrs[0] == 0:
97 print >> sys.stderr, 'seed:', hex(seed)[:-1]
97 print('seed:', hex(seed)[:-1], file=sys.stderr)
98 if gerrs[0] == 0:
98 if gerrs[0] == 0:
99 print >> sys.stderr, 'graph:', graph
99 print('graph:', graph, file=sys.stderr)
100 print >> sys.stderr, '* bases:', bases
100 print('* bases:', bases, file=sys.stderr)
101 print >> sys.stderr, '* seq: ', seq
101 print('* seq: ', seq, file=sys.stderr)
102 print >> sys.stderr, '* output: ', output
102 print('* output: ', output, file=sys.stderr)
103 print >> sys.stderr, '* expected:', expected
103 print('* expected:', expected, file=sys.stderr)
104 nerrs[0] += 1
104 nerrs[0] += 1
105 gerrs[0] += 1
105 gerrs[0] += 1
106
106
@@ -178,14 +178,14 b' graph = {0: [-1], 1: [0], 2: [1], 3: [1]'
178 13: [8]}
178 13: [8]}
179
179
180 def genlazyancestors(revs, stoprev=0, inclusive=False):
180 def genlazyancestors(revs, stoprev=0, inclusive=False):
181 print ("%% lazy ancestor set for %s, stoprev = %s, inclusive = %s" %
181 print(("%% lazy ancestor set for %s, stoprev = %s, inclusive = %s" %
182 (revs, stoprev, inclusive))
182 (revs, stoprev, inclusive)))
183 return ancestor.lazyancestors(graph.get, revs, stoprev=stoprev,
183 return ancestor.lazyancestors(graph.get, revs, stoprev=stoprev,
184 inclusive=inclusive)
184 inclusive=inclusive)
185
185
186 def printlazyancestors(s, l):
186 def printlazyancestors(s, l):
187 print 'membership: %r' % [n for n in l if n in s]
187 print('membership: %r' % [n for n in l if n in s])
188 print 'iteration: %r' % list(s)
188 print('iteration: %r' % list(s))
189
189
190 def test_lazyancestors():
190 def test_lazyancestors():
191 # Empty revs
191 # Empty revs
@@ -235,9 +235,10 b' def test_gca():'
235 cgcas = sorted(cl.index.ancestors(a, b))
235 cgcas = sorted(cl.index.ancestors(a, b))
236 pygcas = sorted(ancestor.ancestors(cl.parentrevs, a, b))
236 pygcas = sorted(ancestor.ancestors(cl.parentrevs, a, b))
237 if cgcas != pygcas:
237 if cgcas != pygcas:
238 print "test_gca: for dag %s, gcas for %d, %d:" % (dag, a, b)
238 print("test_gca: for dag %s, gcas for %d, %d:"
239 print " C returned: %s" % cgcas
239 % (dag, a, b))
240 print " Python returned: %s" % pygcas
240 print(" C returned: %s" % cgcas)
241 print(" Python returned: %s" % pygcas)
241
242
242 def main():
243 def main():
243 seed = None
244 seed = None
@@ -59,7 +59,6 b''
59 tests/sitecustomize.py not using absolute_import
59 tests/sitecustomize.py not using absolute_import
60 tests/svn-safe-append.py not using absolute_import
60 tests/svn-safe-append.py not using absolute_import
61 tests/svnxml.py not using absolute_import
61 tests/svnxml.py not using absolute_import
62 tests/test-ancestor.py requires print_function
63 tests/test-atomictempfile.py not using absolute_import
62 tests/test-atomictempfile.py not using absolute_import
64 tests/test-batching.py not using absolute_import
63 tests/test-batching.py not using absolute_import
65 tests/test-batching.py requires print_function
64 tests/test-batching.py requires print_function
@@ -265,7 +264,6 b''
265 tests/get-with-headers.py: invalid syntax: Missing parentheses in call to 'print' (<unknown>, line *) (glob)
264 tests/get-with-headers.py: invalid syntax: Missing parentheses in call to 'print' (<unknown>, line *) (glob)
266 tests/readlink.py: invalid syntax: invalid syntax (<unknown>, line *) (glob)
265 tests/readlink.py: invalid syntax: invalid syntax (<unknown>, line *) (glob)
267 tests/silenttestrunner.py: invalid syntax: Missing parentheses in call to 'print' (<unknown>, line *) (glob)
266 tests/silenttestrunner.py: invalid syntax: Missing parentheses in call to 'print' (<unknown>, line *) (glob)
268 tests/test-ancestor.py: invalid syntax: Missing parentheses in call to 'print' (<unknown>, line *) (glob)
269 tests/test-batching.py: invalid syntax: invalid syntax (<unknown>, line *) (glob)
267 tests/test-batching.py: invalid syntax: invalid syntax (<unknown>, line *) (glob)
270 tests/test-bdiff.py: invalid syntax: invalid syntax (<unknown>, line *) (glob)
268 tests/test-bdiff.py: invalid syntax: invalid syntax (<unknown>, line *) (glob)
271 tests/test-context.py: invalid syntax: invalid syntax (<unknown>, line *) (glob)
269 tests/test-context.py: invalid syntax: invalid syntax (<unknown>, line *) (glob)
General Comments 0
You need to be logged in to leave comments. Login now