Skip to main content

Spying framework

Project description

Mockito is a spying framework originally based on the Java library with the same name.


pip install mockito

Quick Start

90% use case is that you want to stub out a side effect.

from mockito import when, mock, unstub


# or:
import requests  # the famous library
# you actually want to return a Response-like obj, we'll fake it
response = mock({'status_code': 200, 'text': 'Ok'})

# use it

# clean up

Read the docs

Run the tests

pip install pytest

Project details

Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Files for mockito, version 1.2.2
Filename, size File type Python version Upload date Hashes
Filename, size mockito-1.2.2.tar.gz (23.8 kB) File type Source Python version None Upload date Hashes View

Supported by

AWS AWS Cloud computing Datadog Datadog Monitoring DigiCert DigiCert EV certificate Facebook / Instagram Facebook / Instagram PSF Sponsor Fastly Fastly CDN Google Google Object Storage and Download Analytics Pingdom Pingdom Monitoring Salesforce Salesforce PSF Sponsor Sentry Sentry Error logging StatusPage StatusPage Status page