[Python-checkins] cpython (merge 3.2 -> 3.3): Issue #17041: Fix doctesting when Python is configured with the

serhiy.storchaka python-checkins at python.org
Thu Jan 31 15:13:58 CET 2013


http://hg.python.org/cpython/rev/886f48754f7e
changeset:   81857:886f48754f7e
branch:      3.3
parent:      81853:5bad2c422315
parent:      81856:9c0cd608464e
user:        Serhiy Storchaka <storchaka at gmail.com>
date:        Thu Jan 31 16:11:28 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 @@
 <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
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
@@ -221,7 +221,8 @@
     >>> 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)

-- 
Repository URL: http://hg.python.org/cpython


More information about the Python-checkins mailing list