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 suit some people while others will suit other styles. This library contains common test fixtures the author found himself repeating from package to package 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

This version

4.8.0

Download files

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

Source Distribution

testfixtures-4.8.0.tar.gz (89.8 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

testfixtures-4.8.0-py2.py3-none-any.whl (71.5 kB view details)

Uploaded Python 2Python 3

File details

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

File metadata

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

File hashes

Hashes for testfixtures-4.8.0.tar.gz
Algorithm Hash digest
SHA256 0a7329d70508de99fa266115bf8a683ab698ae19b5f7198e32b3781cd46b2b74
MD5 f3f558d1be89128e1c4bb4f940a56f7e
BLAKE2b-256 84ffe6a97da36f56ae98b965fc66bb495dabd46c5e096e4f2b377c5d74320891

See more details on using hashes here.

File details

Details for the file testfixtures-4.8.0-py2.py3-none-any.whl.

File metadata

File hashes

Hashes for testfixtures-4.8.0-py2.py3-none-any.whl
Algorithm Hash digest
SHA256 99f446175c6346025df1602b45d8e3f1f69ae5d6356a5e095ad7a64a66862aa3
MD5 28b8980ec40989d25b9b2bc0045eb2d6
BLAKE2b-256 94d47c79229c22806d0ebf0409bc9ee019c0d180717bae0b7deed0df1c5a577d

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