@@ -1505,7 +1505,10 @@ def _get_summary_line(o):
15051505 text = pydoc .plain (pydoc .render_doc (o ))
15061506 lines = text .split ('\n ' )
15071507 assert len (lines ) >= 2
1508- return lines [2 ]
1508+ for i in range (3 , len (lines )):
1509+ if lines [i ].startswith (' ' ):
1510+ break
1511+ return '\n ' .join (lines [2 :i ])
15091512
15101513 @staticmethod
15111514 def _get_summary_lines (o ):
@@ -1650,6 +1653,28 @@ def test_bound_builtin_method_unrepresentable_default(self):
16501653 "meth(a, b=<x>) "
16511654 "method of _testcapi.DocStringUnrepresentableSignatureTest instance" )
16521655
1656+ @support .cpython_only
1657+ @requires_docstrings
1658+ def test_unbound_builtin_method_multisig_unrepresentable_default (self ):
1659+ _testcapi = import_helper .import_module ("_testcapi" )
1660+ cls = _testcapi .DocStringUnrepresentableSignatureTest
1661+ self .assertEqual (self ._get_summary_line (cls .meth_multi ),
1662+ "meth_multi(self, /) unbound "
1663+ "_testcapi.DocStringUnrepresentableSignatureTest method\n "
1664+ "meth_multi(self, /, a, b=<x>) unbound "
1665+ "_testcapi.DocStringUnrepresentableSignatureTest method" )
1666+
1667+ @support .cpython_only
1668+ @requires_docstrings
1669+ def test_bound_builtin_method_multisig_unrepresentable_default (self ):
1670+ _testcapi = import_helper .import_module ("_testcapi" )
1671+ obj = _testcapi .DocStringUnrepresentableSignatureTest ()
1672+ self .assertEqual (self ._get_summary_line (obj .meth_multi ),
1673+ "meth_multi() "
1674+ "method of _testcapi.DocStringUnrepresentableSignatureTest instance\n "
1675+ "meth_multi(a, b=<x>) "
1676+ "method of _testcapi.DocStringUnrepresentableSignatureTest instance" )
1677+
16531678 @support .cpython_only
16541679 @requires_docstrings
16551680 def test_unbound_builtin_classmethod_unrepresentable_default (self ):
0 commit comments