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

Method test_staticmethod

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

Source from the content-addressed store, hash-verified

1683
1684 @requires_docstrings
1685 def test_staticmethod(self):
1686 class X:
1687 @staticmethod
1688 def sm(x, y):
1689 '''A static method'''
1690 ...
1691 self.assertEqual(self._get_summary_lines(X.__dict__['sm']),
1692 'sm(x, y)\n'
1693 ' A static method\n')
1694 self.assertEqual(self._get_summary_lines(X.sm), """\
1695sm(x, y)
1696 A static method
1697""")
1698 self.assertIn("""
1699 | Static methods defined here:
1700 |
1701 | sm(x, y)
1702 | A static method
1703""", pydoc.plain(pydoc.render_doc(X)))
1704
1705 @requires_docstrings
1706 def test_classmethod(self):

Callers

nothing calls this directly

Calls 4

_get_summary_linesMethod · 0.95
assertInMethod · 0.80
plainMethod · 0.80
assertEqualMethod · 0.45

Tested by

no test coverage detected