Skip to content

Add some miscellaneous tests - #659

Merged
AlexWaygood merged 13 commits into
python:mainfrom
brianschubert:test-coverage
Aug 30, 2025
Merged

Add some miscellaneous tests#659
AlexWaygood merged 13 commits into
python:mainfrom
brianschubert:test-coverage

Conversation

@brianschubert

Copy link
Copy Markdown
Contributor

Add tests to exercise some previously unexercised lines:

  • _SpecialGenericAlias.__setattr__() for non-dunder, non-"allowed" attributes (src)
  • Wrong number of type arguments given to a _SpecialGenericAlias from without defaults (src)
  • Attempting to specialize a _SpecialGenericAlias with 0 type parameters (src)
  • Setting <thing>.__module__ on Python implementations that don't supply sys._getframemodulename or sys._getframe (src)
  • Calling get_type_hints() with types.GenericAlias (src)
  • Exception raised by __init_subclass__() of ParamSpec (src)
  • The methods __or__() and __ror__() of _SpecialForm (src)
  • The methods __repr__ and __reduce__ of NoExtraItems (test case copied from NoDefaultTests) (src)

Comment threadsrc/test_typing_extensions.py Outdated
Comment threadsrc/test_typing_extensions.py Outdated
Comment threadsrc/test_typing_extensions.py
Comment threadsrc/test_typing_extensions.py

@AlexWaygoodAlexWaygood 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.

nice, thank you!

Comment threadsrc/test_typing_extensions.py Outdated
Comment threadsrc/test_typing_extensions.py
Comment threadsrc/test_typing_extensions.py Outdated
Comment threadsrc/test_typing_extensions.py Outdated
Comment threadsrc/test_typing_extensions.py
@brianschubert

Copy link
Copy Markdown
ContributorAuthor

Thanks for the review! I pushed a few changes. re: making ParamSpec.__init_subclass__ raise in the 3.9 implementation, would this be worth a changelog mention? For reference, the 3.10+ implementation started raising in #165, which didn't include a changelog entry

@DaraanDaraan left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

making ParamSpec.init_subclass raise in the 3.9 implementation, would this be worth a changelog mention? For reference, the 3.10+ implementation started raising in #165, which didn't include a changelog entry.

Imo, it's worth noting. That it is now consistent with the other versions.

Comment threadsrc/test_typing_extensions.py Outdated
@AlexWaygood

Copy link
Copy Markdown
Member

Thanks for the review! I pushed a few changes. re: making ParamSpec.__init_subclass__ raise in the 3.9 implementation, would this be worth a changelog mention? For reference, the 3.10+ implementation started raising in #165, which didn't include a changelog entry

Probably worth it, just to be safe? I feel like #165probably should have had a changelog mention too if it changed behaviour 😄

Comment threadsrc/test_typing_extensions.py
brianschubertand others added 4 commits August 30, 2025 13:30
Co-authored-by: Alex Waygood <alex.waygood@gmail.com>
Co-authored-by: Daraan <github.blurry@9ox.net>

@AlexWaygoodAlexWaygood 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.

Looks great! I think there's a merge conflict

@AlexWaygood
AlexWaygood merged commit ccbfd9b into python:mainAug 30, 2025
23 checks passed
Sign up for freeto join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants

@brianschubert@AlexWaygood@Daraan