From: Serhiy Storchaka Date: Thu, 31 Jan 2013 14:11:04 +0000 (+0200) Subject: Issue #17041: Fix doctesting when Python is configured with the X-Git-Tag: v3.2.4rc1~170 X-Git-Url: http://git.ipfire.org/gitweb.cgi?a=commitdiff_plain;h=9a11f176733b8df1dcdf9e54029937b54d69f5f0;p=thirdparty%2FPython%2Fcpython.git Issue #17041: Fix doctesting when Python is configured with the --without-doc-strings. --- diff --git a/Lib/test/test_generators.py b/Lib/test/test_generators.py index 5f47b3eae033..2c8837383125 100644 --- a/Lib/test/test_generators.py +++ b/Lib/test/test_generators.py @@ -383,7 +383,8 @@ From the Iterators list, about the types of these things. >>> [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 diff --git a/Lib/test/test_genexps.py b/Lib/test/test_genexps.py index 1f46af13e343..d8eb550b02ea 100644 --- a/Lib/test/test_genexps.py +++ b/Lib/test/test_genexps.py @@ -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)