/
Depends on
- dh-python (dh-sequence-python3, pybuild-plugin-pyproject)
- furo (furo)
- pytest (python3-pytest)
- python-pytest-asyncio (python3-pytest-asyncio)
- python3-defaults (python3-all)
- setuptools (python3-setuptools)
- setuptools-scm (python3-setuptools-scm)
- sphinx (dh-sequence-sphinxdoc, sphinx)
- sphinx-copybutton (python3-sphinx-copybutton)
- debhelper-compat
Used by
- accelerate 1.12.0-1
- aiocache 0.12.3-3
- aiodogstatsd 0.16.0-5
- aioftp 0.27.2-1
- ansible 14.0.0+dfsg-1
- ansible-core 2.21.1~rc1-1
- ansible-lint 26.4.0-1
- apprise 1.11.0-1
- apt-listchanges 4.8+nmu2
- augur 24.4.0-3
- blake3-py 1.0.8-4
- cachy 0.3.0-4
- cachy 0.3.0-5
- cctbx 2026.4+ds2+~3.28.0+ds1-2
- cdsetool 0.3.1-1
- check-patroni 2.2.0-3
- clikit 0.6.2-4
- cloud-init 26.1-1
- cmd2 4.0.0+ds-1
- cmd2 4.0.0+ds-2
Show 111 more
- commitizen 4.16.3-1
- commitizen 4.16.4-1
- conda-package-handling 2.4.0-1
- conda-package-streaming 0.12.0-2
- cookiecutter 2.6.0-2
- cwl-utils 0.41-2
- cwltest 2.6.20251216093331-1
- cwltool 3.2.20260413085819-1
- dataclass-wizard 0.39.1-1
- devolo-home-control-api 0.19.1-2
- dh-ros 0.15.0
- dials 3.28.0+dfsg3-1
- diff-cover 10.2.0-1
- django-fsm-log 5.0.2-1
- django-oauth-toolkit 3.2.0-3
- django-redis 5.4.0-1
- fades 9.0.2-2
- fenrir 2026.0.1.28-1
- file-read-backwards 3.2.0-1
- flask-babel 4.1.0-3
- flask-dance 7.1.0-3
- fscacher 0.4.3-0.3
- fsspec 2025.12.0-1
- geopy 2.4.1-3
- gpyfft 0.7.1-3
- guake 3.10.1-1
- guessit 3.8.0-4
- interegular 0.3.3-3
- isort 8.0.1-2
- jenkins-job-builder 6.4.2-5
- journal-brief 1.1.8-4
- jupyter-packaging 0.12.3-5
- labgrid 26.0-1
- lektor 3.3.12-1
- libhmsbeagle 4.0.1+dfsg-5
- litestar 2.24.0-1
- litestar-htmx 0.5.0-1
- lookatme 2.5.4-3
- meson-python 0.19.0-2
- natsort 8.4.0-2
- ncbi-acc-download 0.2.8-3
- offpunk 3.1-3
- python-anyio 4.12.1-1
- python-anyio 4.12.1-2
- python-filelock 3.29.4-1
- python-tzlocal 5.3.1-2
- python-tzlocal 5.4.3-1
- python-uvicorn 0.38.0-1
- requests 2.32.5+dfsg-1
- parametrize 0.2.0-2
- partial-json-parser 0.2.1.1.post5-3
- pass-git-helper 3.2.0-1
- pastel 0.2.1-2
- platformdirs 4.10.0-1
- poetry-core 2.3.1-2
- poetry-plugin-export 1.9.0-3
- prometheus-fastapi-instrumentator 7.1.0-3
- pudb 2025.1.5-1
- pwndck 0.6.2-1
- pydl 1.0.1-3
- pydantic-settings 2.15.0-1
- pyproject-api 1.10.0-1
- pytest-order 1.3.0-1
- pytest-watcher 0.6.3-1
- python-aiosmtpd 1.4.6-6
- python-arcam-fmj 2.1.1-1
- python-auto-pytabs 0.4.0-3
- python-bluecurrent-api 1.2.3-3
- python-colormap 1.3.0-1
- python-cyclopts 4.17.0-2
- python-dropbox 12.2.1-1
- python-easydev 0.13.3+dfsg1-3
- python-filelock 3.32.2-1
- python-git 3.1.50-1
- python-graphviz 0.21-4
- python-headerparser 0.5.1-1
- python-kafka 2.0.2-12
- python-libtmux 0.61.0-2
- python-mashumaro 3.17-1
- python-mechanicalsoup 1.4.0-1
- python-miio 0.5.12-6
- python-pykka 4.2.0-2
- python-pykube-ng 22.9.0-3
- python-pyspnego 0.10.2-4
- python-pyvista 0.48.4-5
- python-rcssmin 1:1.1.2-5
- python-requests-kerberos 0.15.0-2
- python-scramp 1.4.8-1
- python-sshoot 1.6.0-2
- python-tzlocal 5.4.4-1
- python-xopen 1.7.0-4
- qstylizer 0.2.4-1
- radon 6.0.1+ds1-4
- restrictedpython 8.4-1
- rstcheck 6.2.4+~1.2.1-3
- s-tui 1.4.0-1
- shellingham 1.5.4-1
- aioftp 0.28.0-1
- ansible-core 2.21.2-1
- apprise 1.13.0-1
- apt-listchanges 4.8+nmu3
- cloud-init 26.2-1
- cmd2 4.2.0+ds-1
- commitizen 4.18.0-1
- dataclass-wizard 1.0.0-1
- django-oauth-toolkit 3.3.0+dfsg-2
- django-redis 5.4.0-2
- gitlabracadabra 2.8.1
- isort 9.0.1-1
- labgrid 26.0-2
- lektor 3.3.14-0.1
README (full)
pytest-mock
This plugin provides a mocker fixture which is a thin-wrapper around the patching API provided by the mock package:
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.
:target: https://pypi.python.org/pypi/pytest-mock
:target: https://github.com/pytest-dev/pytest-mock/actions
:target: https://coveralls.io/github/pytest-dev/pytest-mock?branch=master
:target: https://pypi.python.org/pypi/pytest-mock/
:target: https://github.com/ambv/black
Professionally supported pytest-mock is available.
Documentation
For full documentation, please see https://pytest-mock.readthedocs.io/en/latest.
License
Distributed under the terms of the MIT license.
| dir | .github/ |
| dir | debian/ |
| dir | docs/ |
| dir | scripts/ |
| dir | src/ |
| dir | tests/ |
| file | .gitignore |
| file | .pre-commit-config.yaml |
| file | .readthedocs.yml |
| file | CHANGELOG.rst |
| file | LICENSE |
| file | PKG-INFO |
| file | README.rst |
| file | RELEASING.rst |
| file | SECURITY.md |
| file | mypy.ini |
| file | pyproject.toml |
| file | setup.cfg |
| file | tox.ini |