[pypy-svn] pypy default: Three small fixes in test_genexps.

arigo commits-noreply at bitbucket.org
Sat Jan 22 12:58:30 CET 2011


Author: Armin Rigo <arigo at tunes.org>
Branch: 
Changeset: r41212:528db5f800f6
Date: 2011-01-22 12:57 +0100
http://bitbucket.org/pypy/pypy/changeset/528db5f800f6/

Log:	Three small fixes in test_genexps.

diff --git a/lib-python/modified-2.7.0/test/test_genexps.py b/lib-python/modified-2.7.0/test/test_genexps.py
--- a/lib-python/modified-2.7.0/test/test_genexps.py
+++ b/lib-python/modified-2.7.0/test/test_genexps.py
@@ -128,9 +128,10 @@
 
 Verify re-use of tuples (a side benefit of using genexps over listcomps)
 
-##  >>> tupleids = map(id, ((i,i) for i in xrange(10)))
-##  >>> int(max(tupleids) - min(tupleids))
-##  0
+    >>> from test.test_support import check_impl_detail
+    >>> tupleids = map(id, ((i,i) for i in xrange(10)))
+    >>> int(max(tupleids) - min(tupleids)) if check_impl_detail() else 0
+    0
 
 Verify that syntax error's are raised for genexps used as lvalues
 
@@ -198,13 +199,13 @@
     >>> g = (10 // i for i in (5, 0, 2))
     >>> g.next()
     2
-    >>> g.next()
+    >>> g.next()       # doctest: +ELLIPSIS
     Traceback (most recent call last):
       File "<pyshell#37>", line 1, in -toplevel-
         g.next()
       File "<pyshell#35>", line 1, in <generator expression>
         g = (10 // i for i in (5, 0, 2))
-    ZeroDivisionError: integer division by zero
+    ZeroDivisionError: integer division...by zero
     >>> g.next()
     Traceback (most recent call last):
       File "<pyshell#38>", line 1, in -toplevel-
@@ -224,7 +225,7 @@
     True
 
     >>> print g.next.__doc__
-    next() -> the next value, or raise StopIteration
+    x.next() -> the next value, or raise StopIteration
     >>> import types
     >>> isinstance(g, types.GeneratorType)
     True


More information about the Pypy-commit mailing list