ppc64le/linux/: pytest-mock-3.14.1+ppc64le1 metadata and description

Simple index

Thin-wrapper around the mock package for easier use with pytest

author_email Bruno Oliveira <nicoddemus@gmail.com>
classifiers
  • Development Status :: 5 - Production/Stable
  • Framework :: Pytest
  • Intended Audience :: Developers
  • License :: OSI Approved :: MIT License
  • Operating System :: OS Independent
  • Programming Language :: Python :: 3
  • Programming Language :: Python :: 3 :: Only
  • Programming Language :: Python :: 3.8
  • Programming Language :: Python :: 3.9
  • Programming Language :: Python :: 3.10
  • Programming Language :: Python :: 3.11
  • Programming Language :: Python :: 3.12
  • Programming Language :: Python :: 3.13
  • Programming Language :: Python :: 3.14
  • Topic :: Software Development :: Testing
  • Environment :: MetaData :: IBM Python Ecosystem
description_content_type text/x-rst
dynamic
  • license-file
keywords pytest,mock
license MIT
license_file
  • LICENSE
project_urls
  • Homepage, https://github.com/pytest-dev/pytest-mock/
  • Documentation, https://pytest-mock.readthedocs.io/en/latest/
  • Changelog, https://pytest-mock.readthedocs.io/en/latest/changelog.html
  • Source, https://github.com/pytest-dev/pytest-mock/
  • Tracker, https://github.com/pytest-dev/pytest-mock/issues
provides_extras
  • dev
requires_dist
  • pytest>=6.2.5
  • pre-commit; extra == "dev"
  • pytest-asyncio; extra == "dev"
  • tox; extra == "dev"
requires_python >=3.8
File Tox results History
pytest_mock-3.14.1+ppc64le1-py3-none-any.whl
Size
10 KB
Type
Python Wheel
Python
3

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.

python version anaconda docs ci coverage black pre-commit

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.

Export Classification Notice

The software hosted on this website consists of publicly available open‑source packages. To the extent U.S. export regulations apply, software that is publicly available as described in 15 C.F.R. §§ 734.7 (for non-encryption software) or 742.15(b) (for encryption software) is not subject to the Export Administration Regulations (EAR). Users are responsible for complying with all applicable export laws and regulations.