Skip to main content

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

Project description

TestFixtures is a collection of helpers and mock objects that are useful when writing unit tests or doc tests.

If you’re wondering why “yet another mock object library”, testing is often described as an art form and as such some styles of library will suite some people while others will suite other styles. This library contains common test fixtures the author found himself repeating from package to packages and so decided to extract them into their own library and give them some tests of their own!

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.

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

Easy to use ways of checking that a certain exception is raised, even down the to the parameters the exception is raised with.

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.

Source Distribution

testfixtures-2.3.3.tar.gz (66.5 kB view details)

Uploaded Source

File details

Details for the file testfixtures-2.3.3.tar.gz.

File metadata

  • Download URL: testfixtures-2.3.3.tar.gz
  • Upload date:
  • Size: 66.5 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No

File hashes

Hashes for testfixtures-2.3.3.tar.gz
Algorithm Hash digest
SHA256 52a5ee0f38c81b8291270da57223735e8179428a346292dae053f1a71cc7af69
MD5 67b1be5bd2076a3fd653c0c88c0a40ad
BLAKE2b-256 2605164bfff266ef4368aef86d01c248e10aac0721522936ea492aae710092e0

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page