Skip to main content

A collection of helpers and mock objects for unit tests and doc tests.

Project description

CircleCI Docs

Testfixtures is a collection of helpers and mock objects that are useful when writing automated tests in Python.

The areas of testing this package can help with are listed below:

Comparing objects and sequences

Better feedback when the results aren’t as you expected along with support for comparison of objects that don’t normally support comparison and comparison of deeply nested datastructures.

Mocking out objects and methods

Easy to use ways of stubbing out objects, classes or individual methods for both doc tests and unit tests. Special helpers are provided for testing with dates and times.

Testing logging

Helpers for capturing logging output in both doc tests and unit tests.

Testing stream output

Helpers for capturing stream output, such as that from print statements, and making assertion about it.

Testing with files and directories

Support for creating and checking files and directories in sandboxes for both doc tests and unit tests.

Testing exceptions and warnings

Easy to use ways of checking that a certain exception is raised, or a warning is issued, even down the to the parameters provided.

Testing subprocesses

A handy mock for testing code that uses subprocesses.

Testing when using django

Helpers for comparing instances of django models.

Testing when using zope.component

An easy to use sterile component registry.

Project details

Release history Release notifications | RSS feed

Download files

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

Files for testfixtures, version 6.18.3
Filename, size File type Python version Upload date Hashes
Filename, size testfixtures-6.18.3-py2.py3-none-any.whl (95.8 kB) File type Wheel Python version py2.py3 Upload date Hashes View
Filename, size testfixtures-6.18.3.tar.gz (122.1 kB) File type Source Python version None Upload date Hashes View

Supported by

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