FazBrowse GitHub Viewer | Trending |
URL:
| Home
Tools: [Download Repo ZIP]   [Original HTTPS Page]

gh-93096: Remove run block in `heapq` by donbarbos · Pull Request #131130 · python/cpython · GitHub

/ cpython Public

gh-93096: Remove run block in heapq - #131130

Closed
donbarbos wants to merge 1 commit into
python:mainfrom
donbarbos:issue-93096-heapq
Closed

gh-93096: Remove run block in heapq#131130
donbarbos wants to merge 1 commit into
python:mainfrom
donbarbos:issue-93096-heapq

Conversation

donbarbos commented Mar 12, 2025
edited
Loading

Copy link
Copy Markdown
Contributor

we can use next command for doctests: ./python -m doctest Lib/heapq.py -v

and we already loading doctest in next line:

def load_tests(loader, tests, ignore):
# The 'merge' function has examples in its docstring which we should test
# with 'doctest'.
#
# However, doctest can't easily find all docstrings in the module (loading
# it through import_fresh_module seems to confuse it), so we specifically
# create a finder which returns the doctests from the merge method.
class HeapqMergeDocTestFinder:
def find(self, *args, **kwargs):
dtf = doctest.DocTestFinder()
return dtf.find(py_heapq.merge)
tests.addTests(doctest.DocTestSuite(py_heapq,
test_finder=HeapqMergeDocTestFinder()))
return tests

Copy link
Copy Markdown
Contributor Author

cc @vstinner

vstinner left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Choose a reason Spam Abuse Off Topic Outdated Duplicate Resolved Low Quality

LGTM

Copy link
Copy Markdown
Contributor

I don't think this addresses any known or real user problem. It just makes life more difficult for the module maintainer.

Copy link
Copy Markdown
Contributor Author

I don't think this addresses any known or real user problem. It just makes life more difficult for the module maintainer.

This looks like redundant code. And we already have more general way to run doctest (via python -m doctest)

rhettinger closed this Mar 20, 2025
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode characters
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants


Back | FazBrowse Home | New Git URL