summaryrefslogtreecommitdiffstats
path: root/Lib/test/test_itertools.py
diff options
context:
space:
mode:
authorKristján Valur Jónsson <kristjan@ccpgames.com>2007-05-03 20:09:56 (GMT)
committerKristján Valur Jónsson <kristjan@ccpgames.com>2007-05-03 20:09:56 (GMT)
commit170eee9d6ae4ad4270cfd164c046c2381d746191 (patch)
tree75570ad8d2a1b630046f6753a6a7fd2c2c11a17c /Lib/test/test_itertools.py
parent19ac472ba12c41e201b91a45e21ebc0b079d3ca1 (diff)
downloadcpython-170eee9d6ae4ad4270cfd164c046c2381d746191.zip
cpython-170eee9d6ae4ad4270cfd164c046c2381d746191.tar.gz
cpython-170eee9d6ae4ad4270cfd164c046c2381d746191.tar.bz2
Fix those parts in the testsuite that assumed that sys.maxint would cause overflow on x64. Now the testsuite is well behaved on that platform.
Diffstat (limited to 'Lib/test/test_itertools.py')
-rw-r--r--Lib/test/test_itertools.py6
1 files changed, 4 insertions, 2 deletions
diff --git a/Lib/test/test_itertools.py b/Lib/test/test_itertools.py
index a8f625c..6c362ad 100644
--- a/Lib/test/test_itertools.py
+++ b/Lib/test/test_itertools.py
@@ -5,6 +5,8 @@ from weakref import proxy
import sys
import operator
import random
+maxsize = test_support.MAX_Py_ssize_t
+minsize = -maxsize-1
def onearg(x):
'Test function of one argument'
@@ -52,7 +54,7 @@ class TestBasicOps(unittest.TestCase):
self.assertEqual(take(2, zip('abc',count(3))), [('a', 3), ('b', 4)])
self.assertRaises(TypeError, count, 2, 3)
self.assertRaises(TypeError, count, 'a')
- self.assertRaises(OverflowError, list, islice(count(sys.maxint-5), 10))
+ self.assertRaises(OverflowError, list, islice(count(maxsize-5), 10))
c = count(3)
self.assertEqual(repr(c), 'count(3)')
c.next()
@@ -330,7 +332,7 @@ class TestBasicOps(unittest.TestCase):
self.assertRaises(ValueError, islice, xrange(10), 1, 'a')
self.assertRaises(ValueError, islice, xrange(10), 'a', 1, 1)
self.assertRaises(ValueError, islice, xrange(10), 1, 'a', 1)
- self.assertEqual(len(list(islice(count(), 1, 10, sys.maxint))), 1)
+ self.assertEqual(len(list(islice(count(), 1, 10, maxsize))), 1)
def test_takewhile(self):
data = [1, 3, 5, 20, 2, 4, 6, 8]