From 55e4be7c1f619e62a973e07cad01810392d5101c Mon Sep 17 00:00:00 2001 From: Patrick Lannigan Date: Mon, 19 Apr 2021 10:41:35 -0400 Subject: [PATCH 1/2] Correct type annotations in patch.dict() --- src/pytest_mock/plugin.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/pytest_mock/plugin.py b/src/pytest_mock/plugin.py index ddcf0b5..15147bc 100644 --- a/src/pytest_mock/plugin.py +++ b/src/pytest_mock/plugin.py @@ -267,7 +267,7 @@ def multiple( def dict( self, - in_dict: Mapping[Any, Any], + in_dict: Union[Mapping[Any, Any], str], values: Union[Mapping[Any, Any], Iterable[Tuple[Any, Any]]] = (), clear: bool = False, **kwargs: Any From 6e5600dd2d159352aa0fbdad36ce5c8752a5166a Mon Sep 17 00:00:00 2001 From: Patrick Lannigan Date: Sat, 24 Apr 2021 15:25:00 -0400 Subject: [PATCH 2/2] Update changelog --- CHANGELOG.rst | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/CHANGELOG.rst b/CHANGELOG.rst index f7f47fd..aa3f710 100644 --- a/CHANGELOG.rst +++ b/CHANGELOG.rst @@ -1,3 +1,12 @@ +3.5.2 (UNRELEASED) +------------------ + +* Correct type annotations for ``mocker.patch.object`` to also include the string form. + Thanks `@plannigan`_ for the PR (`#235`_). + +.. _@plannigan: https://github.com/plannigan +.. _#235: https://github.com/pytest-dev/pytest-mock/pull/235 + 3.5.1 (2021-01-10) ------------------