We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
If you patch coroutine in setUp with MagicMock, you can't redefine it as CoroutineMock using "with" syntax. However, you can do it with decorator.
setUp
MagicMock
CoroutineMock
Here is a simple example to reproduce the situation.
class TestTest(asynctest.TestCase): def setUp(self): wrong_mock = mock.patch("some.service.coro") wrong_mock.start() @asynctest.patch("some.service.coro") def test_ok(self, coro_mock): assert isinstance(coro_mock, asynctest.CoroutineMock) def test_not_ok(self): with asynctest.patch("some.service.coro") as coro_mock: assert isinstance(coro_mock, asynctest.CoroutineMock)
The text was updated successfully, but these errors were encountered:
Lets try to test them.
Sorry, something went wrong.
No branches or pull requests
If you patch coroutine in
setUp
withMagicMock
, you can't redefine it asCoroutineMock
using "with" syntax. However, you can do it with decorator.Here is a simple example to reproduce the situation.
The text was updated successfully, but these errors were encountered: