Browse Source

Intermediate changes

robot-piglet 1 year ago
parent
commit
67017f403e

+ 4 - 4
contrib/python/pytest-mock/py3/.dist-info/METADATA

@@ -1,6 +1,6 @@
 Metadata-Version: 2.1
 Name: pytest-mock
-Version: 3.11.1
+Version: 3.12.0
 Summary: Thin-wrapper around the mock package for easier use with pytest
 Home-page: https://github.com/pytest-dev/pytest-mock/
 Author: Bruno Oliveira
@@ -18,17 +18,17 @@ Classifier: Intended Audience :: Developers
 Classifier: License :: OSI Approved :: MIT License
 Classifier: Operating System :: OS Independent
 Classifier: Programming Language :: Python :: 3
-Classifier: Programming Language :: Python :: 3.7
 Classifier: Programming Language :: Python :: 3.8
 Classifier: Programming Language :: Python :: 3.9
 Classifier: Programming Language :: Python :: 3.10
 Classifier: Programming Language :: Python :: 3.11
+Classifier: Programming Language :: Python :: 3.12
 Classifier: Programming Language :: Python :: 3 :: Only
 Classifier: Topic :: Software Development :: Testing
-Requires-Python: >=3.7
+Requires-Python: >=3.8
 Description-Content-Type: text/x-rst
 License-File: LICENSE
-Requires-Dist: pytest (>=5.0)
+Requires-Dist: pytest >=5.0
 Provides-Extra: dev
 Requires-Dist: pre-commit ; extra == 'dev'
 Requires-Dist: tox ; extra == 'dev'

+ 14 - 2
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)

+ 11 - 2
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:

+ 1 - 1
contrib/python/pytest-mock/py3/ya.make

@@ -2,7 +2,7 @@
 
 PY3_LIBRARY()
 
-VERSION(3.11.1)
+VERSION(3.12.0)
 
 LICENSE(MIT)