@@ -262,7 +262,7 @@ class _patch(Generic[_T]):
262262# This class does not exist at runtime, it's a hack to make this work:
263263# @patch("foo")
264264# def bar(..., mock: MagicMock) -> None: ...
265- class _patch_default_new (_patch [MagicMock | AsyncMock ]):
265+ class _patch_pass_arg (_patch [_T ]):
266266 @overload
267267 def __call__ (self , func : _TT ) -> _TT : ...
268268 # Can't use the following as ParamSpec is only allowed as last parameter:
@@ -317,7 +317,7 @@ class _patcher:
317317 autospec : Any | None = ...,
318318 new_callable : Callable [..., _T ],
319319 ** kwargs : Any ,
320- ) -> _patch [_T ]: ...
320+ ) -> _patch_pass_arg [_T ]: ...
321321 @overload
322322 def __call__ (
323323 self ,
@@ -329,7 +329,7 @@ class _patcher:
329329 autospec : Any | None = ...,
330330 new_callable : None = ...,
331331 ** kwargs : Any ,
332- ) -> _patch_default_new : ...
332+ ) -> _patch_pass_arg [ MagicMock | AsyncMock ] : ...
333333 @overload
334334 @staticmethod
335335 def object (
@@ -355,7 +355,7 @@ class _patcher:
355355 autospec : Any | None = ...,
356356 new_callable : Callable [..., _T ],
357357 ** kwargs : Any ,
358- ) -> _patch [_T ]: ...
358+ ) -> _patch_pass_arg [_T ]: ...
359359 @overload
360360 @staticmethod
361361 def object (
@@ -368,7 +368,7 @@ class _patcher:
368368 autospec : Any | None = ...,
369369 new_callable : None = ...,
370370 ** kwargs : Any ,
371- ) -> _patch [MagicMock | AsyncMock ]: ...
371+ ) -> _patch_pass_arg [MagicMock | AsyncMock ]: ...
372372 @staticmethod
373373 def multiple (
374374 target : Any ,
0 commit comments