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

Fix tests stubs #140

Merged
merged 2 commits into from
Apr 11, 2024
Merged

Conversation

isra17
Copy link
Contributor

@isra17 isra17 commented Apr 3, 2024

The current typing yield the following error:

error: "Coroutine[Any, Any, AsyncIterator[Any]]" has no attribute "__aiter__" (not async iterable)  [attr-defined]

Related to python/mypy#10301

I also took time to add a typing test for every function in itertools that validate the iterator type. I added a dependency to mypy-type-assets to easily assert the type.

typetests/test_itertools.py Fixed Show fixed Hide fixed
typetests/test_itertools.py Fixed Show fixed Hide fixed
@maxfischer2781 maxfischer2781 self-requested a review April 4, 2024 07:27
@maxfischer2781
Copy link
Owner

Good catch. I'll try and review this ASAP.

@maxfischer2781
Copy link
Owner

As a first glance, can you switch from the MyPy assertion plugin to using typing.assert_type (import it from typing_extensions)? The type checks should also work for PyRight, so a general means is preferable.

@isra17
Copy link
Contributor Author

isra17 commented Apr 4, 2024

As a first glance, can you switch from the MyPy assertion plugin to using typing.assert_type (import it from typing_extensions)? The type checks should also work for PyRight, so a general means is preferable.

I wasn't aware of this new function, done!

typetests/test_itertools.py Show resolved Hide resolved
Copy link
Owner

@maxfischer2781 maxfischer2781 left a comment

Choose a reason for hiding this comment

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

Looks good. The only thing left to do is cleanup of unused dependencies.

pyproject.toml Outdated Show resolved Hide resolved
pyproject.toml Outdated Show resolved Hide resolved
typetests/test_itertools.py Show resolved Hide resolved
Co-authored-by: Max Fischer <maxfischer2781@gmail.com>
@isra17
Copy link
Contributor Author

isra17 commented Apr 9, 2024

Looks good. The only thing left to do is cleanup of unused dependencies.

Sorry, forgot to clean up, done

Copy link
Owner

@maxfischer2781 maxfischer2781 left a comment

Choose a reason for hiding this comment

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

This is good to go. Thanks for spotting this issue and for your contribution! 👍

@maxfischer2781 maxfischer2781 merged commit aaeb6d7 into maxfischer2781:master Apr 11, 2024
10 checks passed
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.

None yet

2 participants