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?
With the growing use of
asyncio, we need ways to mock Coroutines.Currently,
mockandunittest.mockdo 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 asunittest.mock, however this requires us to completely re-implement the__init__method ofMockFixture, and removes the "hide traceback" functionality (though we don't care too much about this).This allows us to have both
mockerandasync_mockerfixtures.TLDR
To ease this usecase (and potentially others), Can support for defining a mock modules path from the config be added please?