summaryrefslogtreecommitdiff
path: root/Lib/test/test_pydoc.py
diff options
context:
space:
mode:
Diffstat (limited to 'Lib/test/test_pydoc.py')
-rw-r--r--Lib/test/test_pydoc.py10
1 files changed, 10 insertions, 0 deletions
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: