]> granicus.if.org Git - python/commitdiff
Issue #17041: Fix doctesting when Python is configured with the
authorSerhiy Storchaka <storchaka@gmail.com>
Thu, 31 Jan 2013 14:11:04 +0000 (16:11 +0200)
committerSerhiy Storchaka <storchaka@gmail.com>
Thu, 31 Jan 2013 14:11:04 +0000 (16:11 +0200)
--without-doc-strings.

Lib/test/test_generators.py
Lib/test/test_genexps.py

index 5f47b3eae033678734ad066a8e47641112f4851e..2c8837383125e676a25cf1f71c6d46d66d004f47 100644 (file)
@@ -383,7 +383,8 @@ From the Iterators list, about the types of these things.
 <class 'generator'>
 >>> [s for s in dir(i) if not s.startswith('_')]
 ['close', 'gi_code', 'gi_frame', 'gi_running', 'send', 'throw']
->>> print(i.__next__.__doc__)
+>>> from test.support import HAVE_DOCSTRINGS
+>>> print(i.__next__.__doc__ if HAVE_DOCSTRINGS else 'x.__next__() <==> next(x)')
 x.__next__() <==> next(x)
 >>> iter(i) is i
 True
index 1f46af13e3431b9c09d0bdf24a0bf65b3cf9562b..d8eb550b02ea0d1594c247858b679d5907878075 100644 (file)
@@ -221,7 +221,8 @@ Check that generator attributes are present
     >>> set(attr for attr in dir(g) if not attr.startswith('__')) >= expected
     True
 
-    >>> print(g.__next__.__doc__)
+    >>> from test.support import HAVE_DOCSTRINGS
+    >>> print(g.__next__.__doc__ if HAVE_DOCSTRINGS else 'x.__next__() <==> next(x)')
     x.__next__() <==> next(x)
     >>> import types
     >>> isinstance(g, types.GeneratorType)