Skip to content

Fix mypy errors #193

Closed
Closed

Description

@staticdev

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)

Activity

  1. jtpavlock commented on Aug 6, 2020

    @jtpavlock

    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

  2. staticdev commented on Aug 6, 2020

    @staticdev
    ContributorAuthor

    @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

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions