Debian Codegraph @

/

debian pytest-mock 3.15.1-2debian python3-pytest-mock debian python-pytest-mock-doc python pytest-mock 3.15.1 debianinimakefilemarkdownpythonshelltomlyaml 31 files · 794 symbols
View dependency graph

Depends on

Used by

Show 111 more
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://anaconda.org/conda-forge/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