From 052b2dfdc967a8c061ff9561534e905009b88b8c Mon Sep 17 00:00:00 2001 From: Serhiy Storchaka Date: Mon, 31 Dec 2018 14:15:16 +0200 Subject: 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. --- Lib/test/test_pydoc.py | 10 ++++++++++ 1 file changed, 10 insertions(+) (limited to 'Lib/test/test_pydoc.py') diff --git a/Lib/test/test_pydoc.py b/Lib/test/test_pydoc.py index c58a8b13e7..ffe80fc06f 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: -- cgit v1.2.1