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

typing, annotationlib: clean tests#133087

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

Merged
JelleZijlstra merged 3 commits intopython:mainfromJelleZijlstra:clean-tests
Apr 28, 2025

Conversation

JelleZijlstra
Copy link
Member

  • Add @cpython_only decorator to lazy import tests
  • Rename reference to SOURCE format
  • Always two newlines between test case classes
  • Merge two classes of ForwardRef tests
  • Use get_annotations instead of annotationlib.get_annotations
  • Format test_annotationlib with Black (not expecting that we'll keep this up
    but it's close to Black-formatted right now)
  • Reduce usage of assertTrue/assertFalse. These do truthiness checks, notis checks against True/False, so they could hide issues if our code sets some attributes to some other object instead of a bool. I left assertTrue/assertFalse when calling functions likecallable() that are tested elsewhere.

- Add @cpython_only decorator to lazy import tests- Rename reference to SOURCE format- Always two newlines between test case classes- Merge two classes of ForwardRef tests- Use get_annotations instead of annotationlib.get_annotations- Format test_annotationlib with Black (not expecting that we'll keep this up  but it's close to Black-formatted right now)
@JelleZijlstra
Copy link
MemberAuthor

Let me know if there's other pieces of minor cleanup we could do on the tests.

@@ -6124,8 +6130,6 @@ def test_errors(self):


# We need this to make sure that `@no_type_check` respects `__module__` attr:
Copy link
Member

Choose a reason for hiding this comment

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

this comment seems orphaned now?

Copy link
MemberAuthor

Choose a reason for hiding this comment

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

I think it still makes sense referring to the classes immediately below

@JelleZijlstraJelleZijlstra merged commit7f16f1b intopython:mainApr 28, 2025
50 checks passed
@JelleZijlstraJelleZijlstra deleted the clean-tests branchApril 28, 2025 15:38
Sign up for freeto join this conversation on GitHub. Already have an account?Sign in to comment
Reviewers

@AlexWaygoodAlexWaygoodAlexWaygood approved these changes

Assignees
No one assigned
Labels
skip issueskip newstestsTests in the Lib/test dir
Projects
None yet
Milestone
No milestone
Development

Successfully merging this pull request may close these issues.

2 participants
@JelleZijlstra@AlexWaygood

[8]ページ先頭

©2009-2025 Movatter.jp