Skip to content

Commit 194daa2

Browse files
committed
Fix new_callable overload
1 parent 606e197 commit 194daa2

File tree

1 file changed

+16
-1
lines changed

1 file changed

+16
-1
lines changed

src/pytest_mock/plugin.py

Lines changed: 16 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -286,6 +286,20 @@ def __call__(
286286
) -> _T:
287287
...
288288

289+
@overload
290+
def __call__(
291+
self,
292+
target: str,
293+
new: None,
294+
spec: Optional[builtins.object],
295+
create: bool,
296+
spec_set: Optional[builtins.object],
297+
autospec: Optional[builtins.object],
298+
new_callable: Callable[[], _T],
299+
**kwargs: Any
300+
) -> _T:
301+
...
302+
289303
@overload
290304
def __call__(
291305
self,
@@ -295,7 +309,8 @@ def __call__(
295309
create: bool = ...,
296310
spec_set: Optional[builtins.object] = ...,
297311
autospec: Optional[builtins.object] = ...,
298-
new_callable: Callable[[], _T] = ...,
312+
*,
313+
new_callable: Callable[[], _T],
299314
**kwargs: Any
300315
) -> _T:
301316
...

0 commit comments

Comments
 (0)