diff options
| author | Serhiy Storchaka <storchaka@gmail.com> | 2013-01-31 16:11:28 +0200 |
|---|---|---|
| committer | Serhiy Storchaka <storchaka@gmail.com> | 2013-01-31 16:11:28 +0200 |
| commit | 3ff4571af39a120c5837570f64ee561152ae2be8 (patch) | |
| tree | 9c6b743014279b6f9592285bd7cadb66fc701f4a | |
| parent | cc9e5369d37f91daf36df451b797d42630de839f (diff) | |
| parent | 9a11f176733b8df1dcdf9e54029937b54d69f5f0 (diff) | |
| download | cpython-git-3ff4571af39a120c5837570f64ee561152ae2be8.tar.gz | |
Issue #17041: Fix doctesting when Python is configured with the
--without-doc-strings.
| -rw-r--r-- | Lib/test/test_generators.py | 3 | ||||
| -rw-r--r-- | 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 index 06f67c2ea6..958054aef5 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 diff --git a/Lib/test/test_genexps.py b/Lib/test/test_genexps.py index 413043c5a3..203b336fde 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) |
