Skip to content

Navigation Menu

Sign in
Sign up

Allow use of custom mock implementations #150

Open

Description

With the growing use of asyncio, we need ways to mock Coroutines.

Currently, mock and unittest.mock do not support creating specs for coroutines (AsyncMock is being added in python 3.8).

As a work around, we're using asynctest.mock, which has the same interface as unittest.mock, however this requires us to completely re-implement the __init__ method of MockFixture, and removes the "hide traceback" functionality (though we don't care too much about this).
This allows us to have both mocker and async_mocker fixtures.

TLDR
To ease this usecase (and potentially others), Can support for defining a mock modules path from the config be added please?

Activity

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

      AltStyle によって変換されたページ (->オリジナル) /