diff --git a/src/pytest_mock/plugin.py b/src/pytest_mock/plugin.py index 0d2ac31..6b0ce72 100644 --- a/src/pytest_mock/plugin.py +++ b/src/pytest_mock/plugin.py @@ -173,7 +173,7 @@ def async_stub(self, name: Optional[str] = None) -> AsyncMockType: :return: Stub object. """ return cast( - unittest.mock.AsyncMock, + AsyncMockType, self.mock_module.AsyncMock(spec=lambda *args, **kwargs: None, name=name), )