Movatterモバイル変換


[0]ホーム

URL:


Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

gh-93096: Remove run block inheapq#131130

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to ourterms of service andprivacy statement. We’ll occasionally send you account related emails.

Already on GitHub?Sign in to your account

Closed
donBarbos wants to merge1 commit intopython:mainfromdonBarbos:issue-93096-heapq

Conversation

donBarbos
Copy link
Contributor

@donBarbosdonBarbos commentedMar 12, 2025
edited
Loading

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

and we already loading doctest in next line:

defload_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.
classHeapqMergeDocTestFinder:
deffind(self,*args,**kwargs):
dtf=doctest.DocTestFinder()
returndtf.find(py_heapq.merge)
tests.addTests(doctest.DocTestSuite(py_heapq,
test_finder=HeapqMergeDocTestFinder()))
returntests

@donBarbos
Copy link
ContributorAuthor

cc@vstinner

Copy link
Member

@vstinnervstinner left a comment

Choose a reason for hiding this comment

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

LGTM

@rhettinger
Copy link
Contributor

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

@donBarbos
Copy link
ContributorAuthor

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 (viapython -m doctest)

Sign up for freeto join this conversation on GitHub. Already have an account?Sign in to comment
Reviewers

@vstinnervstinnervstinner approved these changes

@rhettingerrhettingerAwaiting requested review from rhettingerrhettinger is a code owner

Assignees
No one assigned
Projects
None yet
Milestone
No milestone
Development

Successfully merging this pull request may close these issues.

3 participants
@donBarbos@rhettinger@vstinner

[8]ページ先頭

©2009-2025 Movatter.jp