typeddjango / pytest-mypy-plugins

pytest plugin for testing mypy types, stubs, and plugins
https://pypi.org/project/pytest-mypy-plugins/
MIT License
100 stars 26 forks source link

Test failures using Python 3.11 and Mypy 0.981 #105

Closed Delgan closed 1 year ago

Delgan commented 1 year ago

Hi!

Tests are failing on Python 3.11 due to a Mypy error and I'm not sure why. :thinking:

I forked pytest-mypy-plugins and added 3.11-dev Python version to CI tests: https://github.com/Delgan/pytest-mypy-plugins/commit/27f9037897507026519c67fcf016758bd2b3d7a6 You can see the failing test here: https://github.com/Delgan/pytest-mypy-plugins/actions/runs/3166219555/jobs/5155788328

E     ../../opt/hostedtoolcache/Python/3.11.0-rc.2/x64/lib/python3.11/site-packages/mypy/typeshed/stdlib/builtins.pyi:1865: error: Overloaded function signatures 1 and 2 overlap with incompatible return types (diff)
E     ../../opt/hostedtoolcache/Python/3.11.0-rc.2/x64/lib/python3.11/site-packages/mypy/typeshed/stdlib/builtins.pyi:1885: error: Overloaded function signatures 1 and 2 overlap with incompatible return types (diff)

When I manually run mypy on the code base no error is reported, so I'm a bit confused about why it's failing when tests are ran through pytest and this plugin.

sobolevn commented 1 year ago

3.11 is not supported by mypy yet.

Delgan commented 1 year ago

Oh, I see. That could explain the issue, indeed.

Sorry for the noise, then. Feel free to close the ticket. It could be reconsidered when https://github.com/python/mypy/issues/12840 is completed, I guess.

sobolevn commented 1 year ago

Let's leave it open, we would need to inlcude tests for 3.11

Thanks for the report! 😄

ben9923 commented 1 year ago

It appears to be resolved with mypy==0.982 :)