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-134357: Remove unused imports in tests#134340

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

Open
hugovk wants to merge4 commits intopython:main
base:main
Choose a base branch
Loading
fromhugovk:3.15-tests-rm-unused-imports

Conversation

hugovk
Copy link
Member

@hugovkhugovk commentedMay 20, 2025
edited by bedevere-appbot
Loading

Like#120417 and#131152, remove unused imports in tests.

Also add lint rule (F401) to the RuffLib/test/ config.

@hugovkhugovk changed the titleRemove unused imports in testsgh-134357: Remove unused imports in testsMay 20, 2025
@hugovkhugovk marked this pull request as ready for reviewMay 20, 2025 16:24
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. I just have doubt about theLib/test/support/__init__.py change.

@@ -2728,7 +2727,6 @@ def iter_builtin_types():
# Fall back to making a best-effort guess.
if hasattr(object, '__flags__'):
# Look for any type object with the Py_TPFLAGS_STATIC_BUILTIN flag set.
import datetime
Copy link
Member

Choose a reason for hiding this comment

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

This import has to stay. It deserves a# noqa: F401.

@encukou: Can you confirm?

@AlexWaygoodAlexWaygood removed their request for reviewMay 20, 2025 21:16
Comment on lines +9 to +10
ChannelError, ChannelNotFoundError, ChannelClosedError, # noqa: F401
ChannelEmptyError, ChannelNotEmptyError, # noqa: F401
Copy link
Member

Choose a reason for hiding this comment

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

In this specific case maybe better to add a per-file ignore?

Copy link
MemberAuthor

Choose a reason for hiding this comment

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

Or would you prefer the two unused imports on the same line? That way we still check the rest of the file.

Suggested change
ChannelError,ChannelNotFoundError,ChannelClosedError,# noqa: F401
ChannelEmptyError,ChannelNotEmptyError,# noqa: F401
from_interpchannelsimport (
ChannelError,ChannelNotFoundError,ChannelEmptyError,
ChannelClosedError,ChannelNotEmptyError,# noqa: F401
)

Copy link
Member

Choose a reason for hiding this comment

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

I'm fine with the current PR: two lines with# noqa: F401.

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

@vstinnervstinnervstinner approved these changes

@AA-TurnerAA-TurnerAA-Turner left review comments

@Yang-Wei-TingYang-Wei-TingYang-Wei-Ting left review comments

@picnixzpicnixzpicnixz approved these changes

@ericsnowcurrentlyericsnowcurrentlyAwaiting requested review from ericsnowcurrentlyericsnowcurrently is a code owner

@FFY00FFY00Awaiting requested review from FFY00FFY00 is a code owner

@JelleZijlstraJelleZijlstraAwaiting requested review from JelleZijlstraJelleZijlstra is a code owner

@gaogaotiantiangaogaotiantianAwaiting requested review from gaogaotiantiangaogaotiantian is a code owner

@vsajipvsajipAwaiting requested review from vsajipvsajip is a code owner

@gpsheadgpsheadAwaiting requested review from gpsheadgpshead is a code owner

@tirantiranAwaiting requested review from tirantiran is a code owner

Assignees
No one assigned
Projects
None yet
Milestone
No milestone
Development

Successfully merging this pull request may close these issues.

5 participants
@hugovk@vstinner@AA-Turner@picnixz@Yang-Wei-Ting

[8]ページ先頭

©2009-2025 Movatter.jp