summaryrefslogtreecommitdiffstats
path: root/Lib/test/test_generators.py
diff options
context:
space:
mode:
authorSerhiy Storchaka <storchaka@gmail.com>2013-01-31 14:11:47 (GMT)
committerSerhiy Storchaka <storchaka@gmail.com>2013-01-31 14:11:47 (GMT)
commit894499fa27552cc8587e1a41e2ff1298ed0d45d5 (patch)
tree4bdedac20d74a875e55b9ba018a37074797a0dd9 /Lib/test/test_generators.py
parentf22ba81748f243fb6cdd55728500cc4a34149e0a (diff)
parent3ff4571af39a120c5837570f64ee561152ae2be8 (diff)
downloadcpython-894499fa27552cc8587e1a41e2ff1298ed0d45d5.zip
cpython-894499fa27552cc8587e1a41e2ff1298ed0d45d5.tar.gz
cpython-894499fa27552cc8587e1a41e2ff1298ed0d45d5.tar.bz2
Issue #17041: Fix doctesting when Python is configured with the
--without-doc-strings.
Diffstat (limited to 'Lib/test/test_generators.py')
-rw-r--r--Lib/test/test_generators.py3
1 files changed, 2 insertions, 1 deletions
diff --git a/Lib/test/test_generators.py b/Lib/test/test_generators.py
index f5c1a7d..edf3443 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.
<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