Skip to content
This repository was archived by the owner on Nov 23, 2017. It is now read-only.
This repository was archived by the owner on Nov 23, 2017. It is now read-only.

mock.Mock() acts like a Future #454

@popravich

Description

@popravich

Since this changes 32edb29 unittest.mock.Mock being detected
as asyncio.Future.
asyncio.futures.isfuture checks for private attribute _asyncio_future_blocking
to be not None and Mock() (without specs) returns new mock as this attribute.

The use case is here aio-libs-abandoned/aioredis-py#161 — basically, function wrapped with asyncio.coroutine
and set as Mock's method side_effect started to raise TypeError.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels
    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions