aboutsummaryrefslogtreecommitdiffstats
path: root/contrib/python/pytest-mock/py3/pytest_mock
diff options
context:
space:
mode:
authorrobot-piglet <robot-piglet@yandex-team.com>2023-11-03 10:59:55 +0300
committerrobot-piglet <robot-piglet@yandex-team.com>2023-11-03 11:21:56 +0300
commit67017f403ebe21c47e170d88611517911405dccd (patch)
treeee30f4b42cd0763d08222f82bdded48bfccf239c /contrib/python/pytest-mock/py3/pytest_mock
parentebe5271b6b00155b318cd9b95b3ae7bc2cde1d10 (diff)
downloadydb-67017f403ebe21c47e170d88611517911405dccd.tar.gz
Intermediate changes
Diffstat (limited to 'contrib/python/pytest-mock/py3/pytest_mock')
-rw-r--r--contrib/python/pytest-mock/py3/pytest_mock/_version.py16
-rw-r--r--contrib/python/pytest-mock/py3/pytest_mock/plugin.py13
2 files changed, 25 insertions, 4 deletions
diff --git a/contrib/python/pytest-mock/py3/pytest_mock/_version.py b/contrib/python/pytest-mock/py3/pytest_mock/_version.py
index cb3b8cfc44b..9e1a89958d8 100644
--- a/contrib/python/pytest-mock/py3/pytest_mock/_version.py
+++ b/contrib/python/pytest-mock/py3/pytest_mock/_version.py
@@ -1,4 +1,16 @@
# file generated by setuptools_scm
# don't change, don't track in version control
-__version__ = version = '3.11.1'
-__version_tuple__ = version_tuple = (3, 11, 1)
+TYPE_CHECKING = False
+if TYPE_CHECKING:
+ from typing import Tuple, Union
+ VERSION_TUPLE = Tuple[Union[int, str], ...]
+else:
+ VERSION_TUPLE = object
+
+version: str
+__version__: str
+__version_tuple__: VERSION_TUPLE
+version_tuple: VERSION_TUPLE
+
+__version__ = version = '3.12.0'
+__version_tuple__ = version_tuple = (3, 12, 0)
diff --git a/contrib/python/pytest-mock/py3/pytest_mock/plugin.py b/contrib/python/pytest-mock/py3/pytest_mock/plugin.py
index 4e9609ad6a9..673f98bffb4 100644
--- a/contrib/python/pytest-mock/py3/pytest_mock/plugin.py
+++ b/contrib/python/pytest-mock/py3/pytest_mock/plugin.py
@@ -66,12 +66,20 @@ class MockerFixture:
self.call = mock_module.call
self.ANY = mock_module.ANY
self.DEFAULT = mock_module.DEFAULT
- self.create_autospec = mock_module.create_autospec
self.sentinel = mock_module.sentinel
self.mock_open = mock_module.mock_open
if hasattr(mock_module, "seal"):
self.seal = mock_module.seal
+ def create_autospec(
+ self, spec: Any, spec_set: bool = False, instance: bool = False, **kwargs: Any
+ ) -> MockType:
+ m: MockType = self.mock_module.create_autospec(
+ spec, spec_set, instance, **kwargs
+ )
+ self._patches_and_mocks.append((None, m))
+ return m
+
def resetall(
self, *, return_value: bool = False, side_effect: bool = False
) -> None:
@@ -102,7 +110,8 @@ class MockerFixture:
times.
"""
for p, m in reversed(self._patches_and_mocks):
- p.stop()
+ if p is not None:
+ p.stop()
self._patches_and_mocks.clear()
def stop(self, mock: unittest.mock.MagicMock) -> None: