[pypy-svn] pypy default: Skip this test as an implementation detail (like in modified-2.5.2).

arigo commits-noreply at bitbucket.org
Tue Jan 25 17:47:58 CET 2011


Author: Armin Rigo <arigo at tunes.org>
Branch: 
Changeset: r41308:d1b13a601545
Date: 2011-01-24 15:57 +0100
http://bitbucket.org/pypy/pypy/changeset/d1b13a601545/

Log:	Skip this test as an implementation detail (like in modified-2.5.2).

diff --git a/lib-python/modified-2.7.0/test/test_itertools.py b/lib-python/modified-2.7.0/test/test_itertools.py
--- a/lib-python/modified-2.7.0/test/test_itertools.py
+++ b/lib-python/modified-2.7.0/test/test_itertools.py
@@ -864,9 +864,17 @@
         self.assertRaises(TypeError, tee, [1,2], 3, 'x')
 
         # tee object should be instantiable
-        a, b = tee('abc')
-        c = type(a)('def')
-        self.assertEqual(list(c), list('def'))
+        if test_support.check_impl_detail():
+            # XXX I (arigo) would argue that 'type(a)(iterable)' has
+            # ill-defined semantics: it always return a fresh tee object,
+            # but depending on whether 'iterable' is itself a tee object
+            # or not, it is ok or not to continue using 'iterable' after
+            # the call.  I cannot imagine why 'type(a)(non_tee_object)'
+            # would be useful, as 'iter(non_tee_obect)' is equivalent
+            # as far as I can see.
+            a, b = tee('abc')
+            c = type(a)('def')
+            self.assertEqual(list(c), list('def'))
 
         # test long-lagged and multi-way split
         a, b, c = tee(xrange(2000), 3)


More information about the Pypy-commit mailing list