tests: make test-manifest finish importing in Python 3
authorAugie Fackler <raf@durin42.com>
Sun, 28 May 2017 18:08:36 -0400
changeset 32534 0048a852b6aa
parent 32533 d68f3d6bc214
child 32535 260a6f715bd2
tests: make test-manifest finish importing in Python 3 The test is still broken, but now it executes.
tests/test-manifest.py
--- 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):