changeset 32567:0048a852b6aa

tests: make test-manifest finish importing in Python 3 The test is still broken, but now it executes.
author Augie Fackler <raf@durin42.com>
date Sun, 28 May 2017 18:08:36 -0400
parents d68f3d6bc214
children 260a6f715bd2
files tests/test-manifest.py
diffstat 1 files changed, 7 insertions(+), 3 deletions(-) [+]
line wrap: on
line diff
--- a/tests/test-manifest.py	Sun May 28 18:08:14 2017 -0400
+++ b/tests/test-manifest.py	Sun May 28 18:08:36 2017 -0400
@@ -92,11 +92,15 @@
 
 HUGE_MANIFEST_ENTRIES = 200001
 
+izip = getattr(itertools, 'izip', zip)
+if 'xrange' not in globals():
+    xrange = range
+
 A_HUGE_MANIFEST = ''.join(sorted(
     'file%d\0%s%s\n' % (i, h, f) for i, h, f in
-    itertools.izip(xrange(200001),
-                   itertools.cycle((HASH_1, HASH_2)),
-                   itertools.cycle(('', 'x', 'l')))))
+    izip(xrange(200001),
+         itertools.cycle((HASH_1, HASH_2)),
+         itertools.cycle(('', 'x', 'l')))))
 
 class basemanifesttests(object):
     def parsemanifest(self, text):