diff options
author | Sanyam Khurana <8039608+CuriousLearner@users.noreply.github.com> | 2018-12-31 10:44:47 +0530 |
---|---|---|
committer | Nick Coghlan <ncoghlan@gmail.com> | 2018-12-31 15:14:47 +1000 |
commit | b539cef31c060c7eecc331d25a23b80ded0baf08 (patch) | |
tree | 9fed434820ac61d691b3f385a7aeebb897964d73 /Lib/test/test_pydoc.py | |
parent | 1d300ce1d8238136595c8fea76266a4755cd73a2 (diff) | |
download | cpython-git-b539cef31c060c7eecc331d25a23b80ded0baf08.tar.gz |
bpo-35614: Fix pydoc help() on metaclasses (#11357)
Diffstat (limited to 'Lib/test/test_pydoc.py')
-rw-r--r-- | Lib/test/test_pydoc.py | 11 |
1 files changed, 11 insertions, 0 deletions
diff --git a/Lib/test/test_pydoc.py b/Lib/test/test_pydoc.py index 409fea4a5e..c58a8b13e7 100644 --- a/Lib/test/test_pydoc.py +++ b/Lib/test/test_pydoc.py @@ -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(), |