mirror of
https://github.com/python/cpython.git
synced 2025-08-25 11:15:02 +00:00
bpo-35614: Fix pydoc help() on metaclasses (#11357)
This commit is contained in:
parent
1d300ce1d8
commit
b539cef31c
3 changed files with 13 additions and 1 deletions
|
@ -636,6 +636,17 @@ class PydocDocTest(unittest.TestCase):
|
|||
# Testing that the subclasses section does not appear
|
||||
self.assertNotIn('Built-in subclasses', text)
|
||||
|
||||
def test_builtin_on_metaclasses(self):
|
||||
"""Tests help on metaclasses.
|
||||
|
||||
When running help() on a metaclasses such as type, it
|
||||
should not contain any "Built-in subclasses" section.
|
||||
"""
|
||||
doc = pydoc.TextDoc()
|
||||
text = doc.docclass(type)
|
||||
# Testing that the subclasses section does not appear
|
||||
self.assertNotIn('Built-in subclasses', text)
|
||||
|
||||
@unittest.skipIf(sys.flags.optimize >= 2,
|
||||
'Docstrings are omitted with -O2 and above')
|
||||
@unittest.skipIf(hasattr(sys, 'gettrace') and sys.gettrace(),
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue