]> 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:10:15 +0000 (16:10 +0200)
committerSerhiy Storchaka <storchaka@gmail.com>
Thu, 31 Jan 2013 14:10:15 +0000 (16:10 +0200)
--without-doc-strings.

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

index 19bfe074c4ecd34dd4ceb22c80d86d482ba3ec87..27399f73765f7e628dc4d1d3019fe2652d833b2c 100644 (file)
@@ -383,7 +383,8 @@ From the Iterators list, about the types of these things.
 <type 'generator'>
 >>> [s for s in dir(i) if not s.startswith('_')]
 ['close', 'gi_code', 'gi_frame', 'gi_running', 'next', 'send', 'throw']
->>> print i.next.__doc__
+>>> from test.test_support import HAVE_DOCSTRINGS
+>>> print(i.next.__doc__ if HAVE_DOCSTRINGS else 'x.next() -> the next value, or raise StopIteration')
 x.next() -> the next value, or raise StopIteration
 >>> iter(i) is i
 True
index 3d896a530f809ae8c51979972863c03e02541fa5..fc593a31416ce644256beaea57ad461c415245a0 100644 (file)
@@ -223,7 +223,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.test_support import HAVE_DOCSTRINGS
+    >>> print(g.next.__doc__ if HAVE_DOCSTRINGS else 'x.next() -> the next value, or raise StopIteration')
     x.next() -> the next value, or raise StopIteration
     >>> import types
     >>> isinstance(g, types.GeneratorType)