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

Improve test coverage for is_typeddict#104884

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 2 commits intopython:mainfromJelleZijlstra:istdtests
May 24, 2023

Conversation

JelleZijlstra
Copy link
Member

In particular, it's important to test that is_typeddict(TypedDict)
returns False.

In particular, it's important to test that is_typeddict(TypedDict)returns False.
@bedevere-botbedevere-bot added awaiting core review testsTests in the Lib/test dir labelsMay 24, 2023
@JelleZijlstraJelleZijlstra changed the titleImprove test coverage for TypedDictImprove test coverage for is_typeddictMay 24, 2023
Comment on lines 7226 to 7227
assertis_typeddict(Point2D) is True
assertis_typeddict(Union[str, int]) is False
self.assertTrue(is_typeddict(Point2D))
self.assertFalse(is_typeddict(Union[str, int]))
Copy link
Member

Choose a reason for hiding this comment

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

+1 for using the unittest methods, but note that this isn't adirect translation.assertTrue only asserts that the thing is truthy, not that it actually is theTrue constant.

Copy link
MemberAuthor

Choose a reason for hiding this comment

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

Oh good point, I'll switch toassertIs(..., True).

AlexWaygood reacted with thumbs up emoji
self.assertIs(is_typeddict(BarGeneric[int]), False)
self.assertIs(is_typeddict(BarGeneric()), False)

class NewGeneric[T](TypedDict):
Copy link
MemberAuthor

Choose a reason for hiding this comment

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

I'll manually remove this one from the 3.11 backport

AlexWaygood reacted with thumbs up emoji
@JelleZijlstraJelleZijlstra merged commit1497607 intopython:mainMay 24, 2023
@miss-islington
Copy link
Contributor

Thanks@JelleZijlstra for the PR 🌮🎉.. I'm working now to backport this PR to: 3.11, 3.12.
🐍🍒⛏🤖

@JelleZijlstraJelleZijlstra deleted the istdtests branchMay 24, 2023 18:46
@miss-islington
Copy link
Contributor

Sorry@JelleZijlstra, I had trouble checking out the3.12 backport branch.
Please retry by removing and re-adding the "needs backport to 3.12" label.
Alternatively, you can backport usingcherry_picker on the command line.
cherry_picker 1497607a8e99f1103c40368dd5f9057f0146a520 3.12

@bedevere-bot
Copy link

GH-104888 is a backport of this pull request to the3.11 branch.

miss-islington pushed a commit to miss-islington/cpython that referenced this pull requestMay 24, 2023
In particular, it's important to test that is_typeddict(TypedDict)returns False.(cherry picked from commit1497607)Co-authored-by: Jelle Zijlstra <jelle.zijlstra@gmail.com>
@bedevere-botbedevere-bot removed the needs backport to 3.11only security fixes labelMay 24, 2023
@JelleZijlstraJelleZijlstra added needs backport to 3.12only security fixes and removed needs backport to 3.12only security fixes labelsMay 24, 2023
@miss-islington
Copy link
Contributor

Thanks@JelleZijlstra for the PR 🌮🎉.. I'm working now to backport this PR to: 3.12.
🐍🍒⛏🤖

@bedevere-bot
Copy link

GH-104889 is a backport of this pull request to the3.12 branch.

miss-islington pushed a commit to miss-islington/cpython that referenced this pull requestMay 24, 2023
In particular, it's important to test that is_typeddict(TypedDict)returns False.(cherry picked from commit1497607)Co-authored-by: Jelle Zijlstra <jelle.zijlstra@gmail.com>
@bedevere-botbedevere-bot removed the needs backport to 3.12only security fixes labelMay 24, 2023
@AlexWaygood
Copy link
Member

We should probably backport these totyping_extensions too

JelleZijlstra reacted with thumbs up emoji

@JelleZijlstra
Copy link
MemberAuthor

Maybe we should get Miss Islington to do that too :)

AlexWaygood reacted with laugh emoji

AlexWaygood pushed a commit that referenced this pull requestMay 24, 2023
Improve test coverage for is_typeddict (GH-104884)In particular, it's important to test that is_typeddict(TypedDict)returns False.(cherry picked from commit1497607)Co-authored-by: Jelle Zijlstra <jelle.zijlstra@gmail.com>
JelleZijlstra added a commit that referenced this pull requestMay 24, 2023
In particular, it's important to test that is_typeddict(TypedDict)returns False.(cherry picked from commit1497607)Co-authored-by: Jelle Zijlstra <jelle.zijlstra@gmail.com>
@JelleZijlstraJelleZijlstra restored the istdtests branchSeptember 10, 2024 23:37
Sign up for freeto join this conversation on GitHub. Already have an account?Sign in to comment
Reviewers

@AlexWaygoodAlexWaygoodAlexWaygood approved these changes

@gvanrossumgvanrossumAwaiting requested review from gvanrossum

@Fidget-SpinnerFidget-SpinnerAwaiting requested review from Fidget-Spinner

Assignees

@JelleZijlstraJelleZijlstra

Labels
skip issueskip newstestsTests in the Lib/test dirtopic-typing
Projects
None yet
Milestone
No milestone
Development

Successfully merging this pull request may close these issues.

4 participants
@JelleZijlstra@miss-islington@bedevere-bot@AlexWaygood

[8]ページ先頭

©2009-2025 Movatter.jp