[pypy-svn] r10062 - pypy/dist/pypy/lib/test2
alex at codespeak.net
alex at codespeak.net
Tue Mar 22 17:38:43 CET 2005
Author: alex
Date: Tue Mar 22 17:38:43 2005
New Revision: 10062
Modified:
pypy/dist/pypy/lib/test2/test_itertools.py
Log:
made one test shorter (thus faster), commented away one that's too
implementation-dependent and thus unsuitable for pypy
Modified: pypy/dist/pypy/lib/test2/test_itertools.py
==============================================================================
--- pypy/dist/pypy/lib/test2/test_itertools.py (original)
+++ pypy/dist/pypy/lib/test2/test_itertools.py Tue Mar 22 17:38:43 2005
@@ -95,8 +95,11 @@
zip('abc', 'def'))
self.assertEqual([pair for pair in izip('abc', 'def')],
zip('abc', 'def'))
- ids = map(id, izip('abc', 'def'))
- self.assertEqual(min(ids), max(ids))
+ # the following test deals with a specific implementation detail,
+ # that izip "reuses" the SAME tuple object each time when it can;
+ # it does not apply correctly to pypy, so I'm commenting it -- AM
+ # ids = map(id, izip('abc', 'def'))
+ # self.assertEqual(min(ids), max(ids))
ids = map(id, list(izip('abc', 'def')))
self.assertEqual(len(dict.fromkeys(ids)), len(ids))
@@ -174,7 +177,9 @@
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)
+ # too slow to test on pypy, weakened...:
+ # self.assertEqual(len(list(islice(count(), 1, 10, sys.maxint))), 1)
+ self.assertEqual(len(list(islice(count(), 1, 10, 99))), 1)
def test_takewhile(self):
data = [1, 3, 5, 20, 2, 4, 6, 8]
More information about the Pypy-commit
mailing list