mirror of
https://github.com/python/cpython.git
synced 2025-09-26 18:29:57 +00:00
Issue #17041: Fix doctesting when Python is configured with the
--without-doc-strings.
This commit is contained in:
parent
8d510cd6e1
commit
c5200b489d
2 changed files with 4 additions and 2 deletions
|
@ -383,7 +383,8 @@ From the Iterators list, about the types of these things.
|
||||||
<type 'generator'>
|
<type 'generator'>
|
||||||
>>> [s for s in dir(i) if not s.startswith('_')]
|
>>> [s for s in dir(i) if not s.startswith('_')]
|
||||||
['close', 'gi_code', 'gi_frame', 'gi_running', 'next', 'send', 'throw']
|
['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
|
x.next() -> the next value, or raise StopIteration
|
||||||
>>> iter(i) is i
|
>>> iter(i) is i
|
||||||
True
|
True
|
||||||
|
|
|
@ -223,7 +223,8 @@ Check that generator attributes are present
|
||||||
>>> set(attr for attr in dir(g) if not attr.startswith('__')) >= expected
|
>>> set(attr for attr in dir(g) if not attr.startswith('__')) >= expected
|
||||||
True
|
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
|
x.next() -> the next value, or raise StopIteration
|
||||||
>>> import types
|
>>> import types
|
||||||
>>> isinstance(g, types.GeneratorType)
|
>>> isinstance(g, types.GeneratorType)
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue