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

bpo-46685: improve test coverage of Self and Never in typing #31222

Merged
merged 5 commits into from Feb 19, 2022

Conversation

sobolevn
Copy link
Member

@sobolevn sobolevn commented Feb 8, 2022

@JelleZijlstra
Copy link
Member

While you're fixing tests, would you mind renaming the AllTests class to DunderAllTests? Every time I see it that name confuses me into thinking it has all of the tests.

@JelleZijlstra
Copy link
Member

On second thought, maybe not: if we make that change we should do it in the bugfix branches too, but the rest of this PR is only applicable to 3.11.

@sobolevn
Copy link
Member Author

sobolevn commented Feb 8, 2022

@JelleZijlstra by the way, while working on __all__ in typeshed, I've noticed that many modules with __all__ don't have check__all__ test.

I can send a PR with it, if others think it is a good idea.

I personally think, that it is! Because it can help us catching problems with public / not-exported names in the future.

Lib/test/test_typing.py Outdated Show resolved Hide resolved
JelleZijlstra added a commit to JelleZijlstra/typing that referenced this pull request Feb 9, 2022
Copy link
Contributor

@GBeauregard GBeauregard left a comment

Choose a reason for hiding this comment

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

Thanks.

There are other typeforms where the _type_check path is untested too, and not just special forms. For the most part you can test all of them with stringification+get_type_hints. I'd been thinking lately about the best idea for fixing this coverage gap but haven't gotten to it.

The only one I'm currently aware of that fails such a check are ParamSpec's P.args and P.kwargs. I have a bpo open for this from the Annotated side of the bug, but it's the same problem. I will fix it when that stuff gets hashed out. But, I fixed 3 or so other bugs that would have been caught by these types of tests over the past 2 weeks, so there may be more 👀

JelleZijlstra added a commit to python/typing that referenced this pull request Feb 11, 2022
Copy link
Member

@JelleZijlstra JelleZijlstra left a comment

Choose a reason for hiding this comment

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

I am planning to merge in a few days (cc @gvanrossum).

Copy link
Member

@gvanrossum gvanrossum left a comment

Choose a reason for hiding this comment

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

+1

@JelleZijlstra JelleZijlstra merged commit 32e3e0b into python:main Feb 19, 2022
JelleZijlstra added a commit to python/typing_extensions that referenced this pull request May 19, 2022
JelleZijlstra added a commit to python/typing_extensions that referenced this pull request May 19, 2022
JelleZijlstra added a commit to python/typing_extensions that referenced this pull request May 19, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
skip news tests Tests in the Lib/test dir
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

6 participants