cpython (2.7): Issue #17041: Fix doctesting when Python is configured with the
![](https://secure.gravatar.com/avatar/8ac615df352a970211b0e3d94a307c6d.jpg?s=120&d=mm&r=g)
http://hg.python.org/cpython/rev/df9f8feb7444 changeset: 81855:df9f8feb7444 branch: 2.7 parent: 81851:af41eca1959e user: Serhiy Storchaka <storchaka@gmail.com> date: Thu Jan 31 16:10:15 2013 +0200 summary: Issue #17041: Fix doctesting when Python is configured with the --without-doc-strings. files: Lib/test/test_generators.py | 3 ++- Lib/test/test_genexps.py | 3 ++- 2 files changed, 4 insertions(+), 2 deletions(-) diff --git a/Lib/test/test_generators.py b/Lib/test/test_generators.py --- a/Lib/test/test_generators.py +++ b/Lib/test/test_generators.py @@ -383,7 +383,8 @@ <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 diff --git a/Lib/test/test_genexps.py b/Lib/test/test_genexps.py --- a/Lib/test/test_genexps.py +++ b/Lib/test/test_genexps.py @@ -223,7 +223,8 @@ >>> 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) -- Repository URL: http://hg.python.org/cpython
participants (1)
-
serhiy.storchaka