This commit is contained in:
Iliyan Angelov
2025-11-23 18:59:18 +02:00
parent be07802066
commit 627959f52b
1840 changed files with 236564 additions and 3475 deletions

View File

@@ -0,0 +1,105 @@
Metadata-Version: 2.4
Name: pytest-mock
Version: 3.15.1
Summary: Thin-wrapper around the mock package for easier use with pytest
Author-email: Bruno Oliveira <nicoddemus@gmail.com>
License: MIT
Project-URL: Homepage, https://github.com/pytest-dev/pytest-mock/
Project-URL: Documentation, https://pytest-mock.readthedocs.io/en/latest/
Project-URL: Changelog, https://pytest-mock.readthedocs.io/en/latest/changelog.html
Project-URL: Source, https://github.com/pytest-dev/pytest-mock/
Project-URL: Tracker, https://github.com/pytest-dev/pytest-mock/issues
Keywords: pytest,mock
Classifier: Development Status :: 5 - Production/Stable
Classifier: Framework :: Pytest
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 :: Only
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.13
Classifier: Programming Language :: Python :: 3.14
Classifier: Topic :: Software Development :: Testing
Requires-Python: >=3.9
Description-Content-Type: text/x-rst
License-File: LICENSE
Requires-Dist: pytest>=6.2.5
Provides-Extra: dev
Requires-Dist: pre-commit; extra == "dev"
Requires-Dist: pytest-asyncio; extra == "dev"
Requires-Dist: tox; extra == "dev"
Dynamic: license-file
===========
pytest-mock
===========
This plugin provides a ``mocker`` fixture which is a thin-wrapper around the patching API
provided by the `mock package <http://pypi.python.org/pypi/mock>`_:
.. code-block:: python
import os
class UnixFS:
@staticmethod
def rm(filename):
os.remove(filename)
def test_unix_fs(mocker):
mocker.patch('os.remove')
UnixFS.rm('file')
os.remove.assert_called_once_with('file')
Besides undoing the mocking automatically after the end of the test, it also provides other
nice utilities such as ``spy`` and ``stub``, and uses pytest introspection when
comparing calls.
|python| |version| |anaconda| |docs| |ci| |coverage| |black| |pre-commit|
.. |version| image:: http://img.shields.io/pypi/v/pytest-mock.svg
:target: https://pypi.python.org/pypi/pytest-mock
.. |anaconda| image:: https://img.shields.io/conda/vn/conda-forge/pytest-mock.svg
:target: https://anaconda.org/conda-forge/pytest-mock
.. |ci| image:: https://github.com/pytest-dev/pytest-mock/workflows/test/badge.svg
:target: https://github.com/pytest-dev/pytest-mock/actions
.. |coverage| image:: https://coveralls.io/repos/github/pytest-dev/pytest-mock/badge.svg?branch=master
:target: https://coveralls.io/github/pytest-dev/pytest-mock?branch=master
.. |python| image:: https://img.shields.io/pypi/pyversions/pytest-mock.svg
:target: https://pypi.python.org/pypi/pytest-mock/
.. |black| image:: https://img.shields.io/badge/code%20style-black-000000.svg
:target: https://github.com/ambv/black
.. |pre-commit| image:: https://results.pre-commit.ci/badge/github/pytest-dev/pytest-mock/master.svg
:target: https://results.pre-commit.ci/latest/github/pytest-dev/pytest-mock/master
.. |docs| image:: https://readthedocs.org/projects/pytest-mock/badge/?version=latest
:target: https://pytest-mock.readthedocs.io/en/latest/?badge=latest
`Professionally supported pytest-mock is available <https://tidelift.com/subscription/pkg/pypi-pytest_mock?utm_source=pypi-pytest-mock&utm_medium=referral&utm_campaign=readme>`_.
Documentation
=============
For full documentation, please see https://pytest-mock.readthedocs.io/en/latest.
License
=======
Distributed under the terms of the `MIT`_ license.
.. _MIT: https://github.com/pytest-dev/pytest-mock/blob/master/LICENSE

View File

@@ -0,0 +1,17 @@
pytest_mock-3.15.1.dist-info/INSTALLER,sha256=zuuue4knoyJ-UwPPXg8fezS7VCrXJQrAP7zeNuwvFQg,4
pytest_mock-3.15.1.dist-info/METADATA,sha256=BNY0E-9dChaU-8kKqIpN-nyL_WG1KOD7S-5YkvIZ0IY,3899
pytest_mock-3.15.1.dist-info/RECORD,,
pytest_mock-3.15.1.dist-info/REQUESTED,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
pytest_mock-3.15.1.dist-info/WHEEL,sha256=_zCd3N1l69ArxyTb8rzEoP9TpbYXkqRFSNOD5OuxnTs,91
pytest_mock-3.15.1.dist-info/entry_points.txt,sha256=kLSeM0ZCJRR1PqlUzALpxe52ui1Ag7ica4mrqmCX2aU,37
pytest_mock-3.15.1.dist-info/licenses/LICENSE,sha256=tc35IhAzpjNmUVvePoW1LB-y2yk8HZhXeExVY6VEGcM,1075
pytest_mock-3.15.1.dist-info/top_level.txt,sha256=g25fQWB0jTCpAGM1n3t-0RlLvKJIM-t7-WwhbeYf0OU,12
pytest_mock/__init__.py,sha256=oh9IvRFf4He9YjPHxttOSfpgIpOydOg2bs2tSVgkgYA,825
pytest_mock/__pycache__/__init__.cpython-312.pyc,,
pytest_mock/__pycache__/_util.cpython-312.pyc,,
pytest_mock/__pycache__/_version.cpython-312.pyc,,
pytest_mock/__pycache__/plugin.cpython-312.pyc,,
pytest_mock/_util.py,sha256=IPXeNO9fOOf7wth_CCkUA_O8yrBAQDwMuFB2eUNSWsA,930
pytest_mock/_version.py,sha256=303j3tKYk28DKGdLIfzneWfc-qSQv8QTVjNPpLWi-nM,706
pytest_mock/plugin.py,sha256=NIWHMy0_1z836FSGOewtFMjYINsvPGtw5MC9kNIwJpA,25297
pytest_mock/py.typed,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0

View File

@@ -0,0 +1,5 @@
Wheel-Version: 1.0
Generator: setuptools (80.9.0)
Root-Is-Purelib: true
Tag: py3-none-any

View File

@@ -0,0 +1,2 @@
[pytest11]
pytest_mock = pytest_mock

View File

@@ -0,0 +1,21 @@
MIT License
Copyright (c) [2016] [Bruno Oliveira]
Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
in the Software without restriction, including without limitation the rights
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
copies of the Software, and to permit persons to whom the Software is
furnished to do so, subject to the following conditions:
The above copyright notice and this permission notice shall be included in all
copies or substantial portions of the Software.
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
SOFTWARE.