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 mypy errors #193

Closed
staticdev opened this issue Jun 25, 2020 · 2 comments · Fixed by #194
Closed

Fix mypy errors #193

staticdev opened this issue Jun 25, 2020 · 2 comments · Fixed by #194

Comments

@staticdev
Copy link
Contributor

staticdev commented Jun 25, 2020

First step to provide type annotations support #152 (in order to do that, python 3.5 need to be dropped)

Current errors:

src/pytest_mock/plugin.py:5: error: Skipping analyzing 'pytest': found module but no type hints or library stubs
src/pytest_mock/plugin.py:5: note: See https://mypy.readthedocs.io/en/latest/running_mypy.html#missing-imports
src/pytest_mock/plugin.py:7: error: Skipping analyzing 'pytest_mock._version': found module but no type hints or library stubs
src/pytest_mock/plugin.py:210: error: Need type annotation for '_mock_module_originals' (hint: "_mock_module_originals: Dict[<type>, <type>] = ...")
src/pytest_mock/plugin.py:238: error: Assignment to variable 'e' outside except: block
Found 4 errors in 1 file (checked 1 source file)
@jtpavlock
Copy link

I think it's worth noting that pytest uses type annotations as of 6.0. This would be nice to also implement here, but I am also confused by the requirement of dropping 3.5, since type annotations are supported in 3.5

@staticdev
Copy link
Contributor Author

@jtpavlock you are correct, it seems to have some workarounds regarding 3.5, I will try to make it compatible based on pytest 6.0 configs.

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 a pull request may close this issue.

2 participants