Skip to main content

DO NOT USE THIS LIBRARY: there is now a standard mocking library in Python. I will not fix anything in this library and I’m migrating my own projects to unittest.mock.

MockMockMock is a Python (2.7+ and 3.3+) mocking library focusing on very explicit definition of the mocks’ behaviour. It allows as-specific-as-needed unit-tests as well as more generic ones.

It’s licensed under the MIT license. It’s available on the Python package index, its documentation is hosted by Python and its source code is on GitHub.

https://img.shields.io/travis/jacquev6/MockMockMock/master.svg https://img.shields.io/coveralls/jacquev6/MockMockMock/master.svg https://img.shields.io/codeclimate/github/jacquev6/MockMockMock.svg https://img.shields.io/scrutinizer/g/jacquev6/MockMockMock.svg https://img.shields.io/pypi/dm/MockMockMock.svg https://img.shields.io/pypi/l/MockMockMock.svg https://img.shields.io/pypi/v/MockMockMock.svg https://img.shields.io/pypi/pyversions/MockMockMock.svg https://img.shields.io/pypi/status/MockMockMock.svg https://img.shields.io/github/issues/jacquev6/MockMockMock.svg https://badge.waffle.io/jacquev6/MockMockMock.png?label=ready&title=ready https://img.shields.io/github/forks/jacquev6/MockMockMock.svg https://img.shields.io/github/stars/jacquev6/MockMockMock.svg

Quick start

Install from PyPI:

$ pip install MockMockMock

Import:

>>> from MockMockMock import *

Write some code to test:

>>> def f(source):
...   return source.get(42) * 2

Mock:

>>> mocks = Engine()
>>> mock = mocks.create("mocks")

Expect:

>>> mock.expect.get(42).and_return(12)

Test:

>>> assert f(mock.object) == 24

Verify all expected calls have been done:

>>> mocks.tearDown()

Metadata

Release files for MockMockMock 0.5.3

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for MockMockMock 0.5.3
File Size Uploaded Provenance Actions
MockMockMock-0.5.3.tar.gz 11.6 kB Without provenance Details for MockMockMock-0.5.3.tar.gz

Release files / MockMockMock-0.5.3.tar.gz

Download URL MockMockMock-0.5.3.tar.gz
Size 11.6 kB
Tags Source
SHA-256 checksum
How to use checksums
f2f567a56ae3f725be53da72f41bb59371012a85a065940b780684067b3ec6e6
BLAKE2b-256 checksum
How to use checksums
05afa8b94f4fe25aa516c874346f59aaf46e5e0154b4bcebc96a6a785973c53b
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No

Security for MockMockMock 0.5.3

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

No provenance found

None of the files in this release were uploaded with provenance metadata.

A note on package security

PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.

To learn more about protecting yourself from malicious actors, visit our package security documentation.

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page