Skip to content

Use more precise exception types in assertRaises in typing tests #98650

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 our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged

Conversation

sobolevn
Copy link
Member

Exception base-class is too broad, literally anything can be thrown.
We can be more precise with using TypeError instead: this is exactly what is thrown.

Going to skip issue for this, it is very minor.

@miss-islington
Copy link
Contributor

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

miss-islington pushed a commit to miss-islington/cpython that referenced this pull request Oct 25, 2022
…ythonGH-98650)

(cherry picked from commit 45c8935)

Co-authored-by: Nikita Sobolev <mail@sobolevn.me>
@bedevere-bot
Copy link

GH-98655 is a backport of this pull request to the 3.11 branch.

@bedevere-bot bedevere-bot removed the needs backport to 3.11 only security fixes label Oct 25, 2022
miss-islington pushed a commit to miss-islington/cpython that referenced this pull request Oct 25, 2022
…ythonGH-98650)

(cherry picked from commit 45c8935)

Co-authored-by: Nikita Sobolev <mail@sobolevn.me>
@bedevere-bot
Copy link

GH-98656 is a backport of this pull request to the 3.10 branch.

@bedevere-bot bedevere-bot removed the needs backport to 3.10 only security fixes label Oct 25, 2022
miss-islington added a commit that referenced this pull request Oct 25, 2022
…H-98650)

(cherry picked from commit 45c8935)

Co-authored-by: Nikita Sobolev <mail@sobolevn.me>
miss-islington added a commit that referenced this pull request Oct 25, 2022
…H-98650)

(cherry picked from commit 45c8935)

Co-authored-by: Nikita Sobolev <mail@sobolevn.me>
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.

4 participants