ppc64le/linux/: pytest-mock-3.14.1+ppc64le1 metadata and description
Thin-wrapper around the mock package for easier use with pytest
| author_email | Bruno Oliveira <nicoddemus@gmail.com> |
| classifiers |
|
| description_content_type | text/x-rst |
| dynamic |
|
| keywords | pytest,mock |
| license | MIT |
| license_file |
|
| metadata_version | 2.4 |
| project_urls |
|
| provides_extras |
|
| requires_dist |
|
| requires_python | >=3.8 |
| File | Tox results | History |
|---|---|---|
pytest_mock-3.14.1+ppc64le1-py3-none-any.whl
|
|
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.
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.