Closed as not planned
Description
If a decorator transforms a method, the autospecced mock will be wrong.
e.g. Something like:
def acquire(
func: Callable[Concatenate[_Client, Connection, _P], Awaitable[_T]]
) -> Callable[Concatenate[_Client, _P], Awaitable[_T]]:
@functools.wraps(func)
async def wrapper(self: _Client, *args: _P.args, **kwargs: _P.kwargs) -> _T:
conn = await self._pool.acquire()
return await func(self, conn, *args, **kwargs)
return wrapperWill result in the mock requiring the first connection parameter when called, but the real method will already have that parameter provided by the decorator.
I assume autospec is currently only looking at the wraps information when inspecting the signature, but maybe it could make use of the type annotations to provide a more accurate mock.

