{"id":13494168,"url":"https://github.com/pytest-dev/pytest-mock","last_synced_at":"2025-05-14T07:07:53.780Z","repository":{"id":18712485,"uuid":"21923259","full_name":"pytest-dev/pytest-mock","owner":"pytest-dev","description":"Thin-wrapper around the mock package for easier use with pytest","archived":false,"fork":false,"pushed_at":"2025-05-05T20:29:45.000Z","size":670,"stargazers_count":1933,"open_issues_count":11,"forks_count":145,"subscribers_count":37,"default_branch":"main","last_synced_at":"2025-05-07T06:59:28.209Z","etag":null,"topics":["hacktoberfest","mock","pytest"],"latest_commit_sha":null,"homepage":"https://pytest-mock.readthedocs.io/en/latest/","language":"Python","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/pytest-dev.png","metadata":{"files":{"readme":"README.rst","changelog":"CHANGELOG.rst","contributing":"docs/contributing.rst","funding":".github/FUNDING.yml","license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":"SECURITY.md","support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null,"zenodo":null},"funding":{"tidelift":"pypi/pytest-mock"}},"created_at":"2014-07-17T00:40:32.000Z","updated_at":"2025-05-05T20:29:49.000Z","dependencies_parsed_at":"2024-03-26T18:30:31.280Z","dependency_job_id":"9736cc6f-c37c-4733-93d4-287f21ef1f13","html_url":"https://github.com/pytest-dev/pytest-mock","commit_stats":{"total_commits":486,"total_committers":75,"mean_commits":6.48,"dds":"0.47530864197530864","last_synced_commit":"a69d553e580671ab6427e89974a395146e0f8106"},"previous_names":[],"tags_count":65,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/pytest-dev%2Fpytest-mock","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/pytest-dev%2Fpytest-mock/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/pytest-dev%2Fpytest-mock/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/pytest-dev%2Fpytest-mock/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/pytest-dev","download_url":"https://codeload.github.com/pytest-dev/pytest-mock/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":253523689,"owners_count":21921815,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["hacktoberfest","mock","pytest"],"created_at":"2024-07-31T19:01:22.511Z","updated_at":"2025-05-14T07:07:53.745Z","avatar_url":"https://github.com/pytest-dev.png","language":"Python","readme":"===========\npytest-mock\n===========\n\nThis plugin provides a ``mocker`` fixture which is a thin-wrapper around the patching API\nprovided by the `mock package \u003chttp://pypi.python.org/pypi/mock\u003e`_:\n\n.. code-block:: python\n\n    import os\n\n    class UnixFS:\n\n        @staticmethod\n        def rm(filename):\n            os.remove(filename)\n\n    def test_unix_fs(mocker):\n        mocker.patch('os.remove')\n        UnixFS.rm('file')\n        os.remove.assert_called_once_with('file')\n\n\nBesides undoing the mocking automatically after the end of the test, it also provides other\nnice utilities such as ``spy`` and ``stub``, and uses pytest introspection when\ncomparing calls.\n\n|python| |version| |anaconda| |docs| |ci| |coverage| |black| |pre-commit|\n\n.. |version| image:: http://img.shields.io/pypi/v/pytest-mock.svg\n  :target: https://pypi.python.org/pypi/pytest-mock\n\n.. |anaconda| image:: https://img.shields.io/conda/vn/conda-forge/pytest-mock.svg\n    :target: https://anaconda.org/conda-forge/pytest-mock\n\n.. |ci| image:: https://github.com/pytest-dev/pytest-mock/workflows/test/badge.svg\n  :target: https://github.com/pytest-dev/pytest-mock/actions\n\n.. |coverage| image:: https://coveralls.io/repos/github/pytest-dev/pytest-mock/badge.svg?branch=master\n  :target: https://coveralls.io/github/pytest-dev/pytest-mock?branch=master\n\n.. |python| image:: https://img.shields.io/pypi/pyversions/pytest-mock.svg\n  :target: https://pypi.python.org/pypi/pytest-mock/\n\n.. |black| image:: https://img.shields.io/badge/code%20style-black-000000.svg\n  :target: https://github.com/ambv/black\n\n.. |pre-commit| image:: https://results.pre-commit.ci/badge/github/pytest-dev/pytest-mock/master.svg\n   :target: https://results.pre-commit.ci/latest/github/pytest-dev/pytest-mock/master\n\n.. |docs| image:: https://readthedocs.org/projects/pytest-mock/badge/?version=latest\n   :target: https://pytest-mock.readthedocs.io/en/latest/?badge=latest\n\n\n`Professionally supported pytest-mock is available \u003chttps://tidelift.com/subscription/pkg/pypi-pytest_mock?utm_source=pypi-pytest-mock\u0026utm_medium=referral\u0026utm_campaign=readme\u003e`_.\n\n\nDocumentation\n=============\n\nFor full documentation, please see https://pytest-mock.readthedocs.io/en/latest.\n\nLicense\n=======\n\nDistributed under the terms of the `MIT`_ license.\n\n\n.. _MIT: https://github.com/pytest-dev/pytest-mock/blob/master/LICENSE\n","funding_links":["https://tidelift.com/funding/github/pypi/pytest-mock","https://tidelift.com/subscription/pkg/pypi-pytest_mock?utm_source=pypi-pytest-mock\u0026utm_medium=referral\u0026utm_campaign=readme"],"categories":["Python","Testing Tools"],"sub_categories":[],"project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fpytest-dev%2Fpytest-mock","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fpytest-dev%2Fpytest-mock","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fpytest-dev%2Fpytest-mock/lists"}