Skip to content

Patch methods should return AsyncMock if the target is an async method #254

Closed
@GDYendell

Description

@GDYendell

This would match the behaviour of the equivalent methods in mock

Currently, I can pass new_callable=AsyncMock to make it work, but then mypy type checking fails because the type hints state that the methods return MagicMock. The return type is a union in the mock stubs.

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions