Skip to content

isinstance(x, mock.Mock) is broken since Mock is aliased to Any #3224

@JukkaL

Description

@JukkaL

#3182 changed mock.Mock to be an alias to Any, which resulted in mypy complaining about isinstance(x, mock.Mock), which I believe should be valid.

We can fix this by reverting #3182 or potentially by making Mock a class with an Any base class. Mock is a class at runtime, so making it an alias to Any (which is not a class) seems wrong to me.

Metadata

Metadata

Assignees

No one assigned

    Labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions