Skip to content

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, not is 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 like callable() 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
Member Author

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

self.assertIs(assert_type(arg, 'hello'), arg)


# 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
Member Author

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

@JelleZijlstra JelleZijlstra merged commit 7f16f1b into python:main Apr 28, 2025
50 checks passed
@JelleZijlstra JelleZijlstra deleted the clean-tests branch April 28, 2025 15:38
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

skip issue skip news tests Tests in the Lib/test dir

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants