mirror of
https://github.com/davidhalter/typeshed.git
synced 2025-12-07 20:54:28 +08:00
unittest.mock: target must be a str (#7672)
See [the CPython source](eaa85cb22f/Lib/unittest/mock.py (L1754)). It calls `_get_target`, and [that](eaa85cb22f/Lib/unittest/mock.py (L1594)) does `target.rsplit('.', 1)`.
This commit is contained in:
@@ -297,7 +297,7 @@ class _patcher:
|
||||
@overload
|
||||
def __call__( # type: ignore[misc]
|
||||
self,
|
||||
target: Any,
|
||||
target: str,
|
||||
new: _T,
|
||||
spec: Any | None = ...,
|
||||
create: bool = ...,
|
||||
@@ -309,7 +309,7 @@ class _patcher:
|
||||
@overload
|
||||
def __call__(
|
||||
self,
|
||||
target: Any,
|
||||
target: str,
|
||||
*,
|
||||
spec: Any | None = ...,
|
||||
create: bool = ...,
|
||||
|
||||
Reference in New Issue
Block a user