Issue #17041: Fix doctesting when Python is configured with the
--without-doc-strings.
This commit is contained in:
commit
3ff4571af3
|
@ -383,7 +383,8 @@ From the Iterators list, about the types of these things.
|
||||||
<class 'generator'>
|
<class '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', 'send', 'throw']
|
['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)
|
x.__next__() <==> next(x)
|
||||||
>>> iter(i) is i
|
>>> iter(i) is i
|
||||||
True
|
True
|
||||||
|
|
|
@ -221,7 +221,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.support import HAVE_DOCSTRINGS
|
||||||
|
>>> print(g.__next__.__doc__ if HAVE_DOCSTRINGS else 'x.__next__() <==> next(x)')
|
||||||
x.__next__() <==> next(x)
|
x.__next__() <==> next(x)
|
||||||
>>> import types
|
>>> import types
|
||||||
>>> isinstance(g, types.GeneratorType)
|
>>> isinstance(g, types.GeneratorType)
|
||||||
|
|
Loading…
Reference in New Issue