diff options
author | Serhiy Storchaka <storchaka@gmail.com> | 2018-12-31 12:15:16 (GMT) |
---|---|---|
committer | GitHub <noreply@github.com> | 2018-12-31 12:15:16 (GMT) |
commit | 052b2dfdc967a8c061ff9561534e905009b88b8c (patch) | |
tree | 1b9c6c026ff687e9332116d52d2d9ec55acf1abb /Lib/test/test_pydoc.py | |
parent | 5c117dd227e1b4c4f0a62564d8592f1ba45c91eb (diff) | |
download | cpython-052b2dfdc967a8c061ff9561534e905009b88b8c.zip cpython-052b2dfdc967a8c061ff9561534e905009b88b8c.tar.gz cpython-052b2dfdc967a8c061ff9561534e905009b88b8c.tar.bz2 |
bpo-32492: Tweak _collections._tuplegetter. (GH-11367)
* Replace the docstrings cache with sys.intern().
* Improve tests.
* Unify names of tp_descr_get and tp_descr_set functions.
Diffstat (limited to 'Lib/test/test_pydoc.py')
-rw-r--r-- | Lib/test/test_pydoc.py | 10 |
1 files changed, 10 insertions, 0 deletions
diff --git a/Lib/test/test_pydoc.py b/Lib/test/test_pydoc.py index c58a8b1..ffe80fc 100644 --- a/Lib/test/test_pydoc.py +++ b/Lib/test/test_pydoc.py @@ -687,6 +687,16 @@ class PydocDocTest(unittest.TestCase): finally: pydoc.getpager = getpager_old + def test_namedtuple_fields(self): + Person = namedtuple('Person', ['nickname', 'firstname']) + with captured_stdout() as help_io: + pydoc.help(Person) + helptext = help_io.getvalue() + self.assertIn("nickname", helptext) + self.assertIn("firstname", helptext) + self.assertIn("Alias for field number 0", helptext) + self.assertIn("Alias for field number 1", helptext) + def test_namedtuple_public_underscore(self): NT = namedtuple('NT', ['abc', 'def'], rename=True) with captured_stdout() as help_io: |