Skip to content

Non async versions of Proxy classes #59

Open
@diogobaeder

Description

@diogobaeder

Hi folks,

Since the introduction of asyncio-compatible methods in the Proxy class, starting from version 1.6.0 of this library, a bunch of tests for a project I have started breaking. The reason is, I use unittest.mock.patch with an object that is fetched from a Proxy, however now since the Proxy implements coroutine methods the patch function always identifies it as asynchronous, which have the effect of making some of my view functions return a coroutine (an AsyncMock instance) instead of a Response object.

I'd like to suggest that someone creates explicit AsyncProxy and SyncProxy classes to avoid this kind of issue, so that it's clear whether the proxied object should be async-compatible or not.

Thanks!

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions