MCPcopy Index your code
hub / github.com/python/cpython / test_namedtuple_fields

Method test_namedtuple_fields

Lib/test/test_pydoc/test_pydoc.py:898–906  ·  view source on GitHub ↗
(self)

Source from the content-addressed store, hash-verified

896 self.assertIn("lambda (a: int, b: int, c: int) -> int", helptext)
897
898 def test_namedtuple_fields(self):
899 Person = namedtuple('Person', ['nickname', 'firstname'])
900 with captured_stdout() as help_io:
901 pydoc.help(Person)
902 helptext = help_io.getvalue()
903 self.assertIn("nickname", helptext)
904 self.assertIn("firstname", helptext)
905 self.assertIn("Alias for field number 0", helptext)
906 self.assertIn("Alias for field number 1", helptext)
907
908 def test_namedtuple_public_underscore(self):
909 NT = namedtuple('NT', ['abc', 'def'], rename=True)

Callers

nothing calls this directly

Calls 5

namedtupleFunction · 0.90
captured_stdoutFunction · 0.90
assertInMethod · 0.80
helpMethod · 0.45
getvalueMethod · 0.45

Tested by

no test coverage detected