Skip to content
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

Output distinct types when type names are ambiguous #15183

Closed
wants to merge 6 commits into from

Conversation

teresa0605
Copy link
Contributor

Fixes #12677

When assert_type fails, when the type of value examined and the specified type have the same name, mypy returns an error with more descriptive and distinct names.

Example:

Error: Expression is of type "mypy-test.SupportsIndex", not "typing_extensions.SupportsIndex"

instead of

Error: Expression is of type "SupportsIndex", not "SupportsIndex" (previous behavior)

Testing:

Added unit tests in test-data/unit/check-assert-type-fail.test.

@teresa0605 teresa0605 closed this May 4, 2023
Sign up for free to 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.

assert_type: Use fully qualified types when names are ambiguous
1 participant