Skip to content

Commit 92a8174

Browse files
andresdelfinoclaude
andcommitted
Check related help topics through help() output
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
1 parent 7dcb98b commit 92a8174

1 file changed

Lines changed: 5 additions & 7 deletions

File tree

‎Lib/test/test_pydoc/test_pydoc.py‎

Lines changed: 5 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -2296,17 +2296,15 @@ def test_keywords(self):
22962296

22972297
def test_related_topics(self):
22982298
# Every related help topic must be something help() can document.
2299-
helper = pydoc.Helper
2300-
for name, target in (*helper.topics.items(), *helper.keywords.items()):
2299+
for name, target in (*pydoc.Helper.topics.items(),
2300+
*pydoc.Helper.keywords.items()):
23012301
if not isinstance(target, tuple):
23022302
continue
23032303
for xref in target[1].split():
23042304
with self.subTest(topic=name, xref=xref):
2305-
self.assertTrue(xref in helper.topics
2306-
or xref in helper.keywords
2307-
or xref in helper.symbols
2308-
or xref == 'keywords' # the keyword list
2309-
or pydoc.locate(xref) is not None)
2305+
buf = StringIO()
2306+
pydoc.Helper(output=buf).help(xref)
2307+
self.assertNotIn('No help entry found', buf.getvalue())
23102308

23112309
def test_interact_empty_line_continues(self):
23122310
# gh-138568: test pressing Enter without input should continue in help session

0 commit comments

Comments
 (0)