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. Specialised helpers and mock objects are provided, including sub-processes, dates and times.

Testing logging

Helpers for capturing logging and checking what has been logged is what was expected.

Testing stream output

Helpers for capturing stream output, such as that from print function calls or even stuff written directly to file descriptors, and making assertions about it.

Testing with files and directories

Support for creating and checking both files and directories in sandboxes including support for other common path libraries.

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 when using django

Helpers for comparing instances of django models.

Testing when using Twisted

Helpers for making assertions about logging when using Twisted.

Project details


Release history Release notifications | RSS feed

This version

8.3.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-8.3.0.tar.gz (137.4 kB view details)

Uploaded Source

Built Distribution

testfixtures-8.3.0-py3-none-any.whl (105.1 kB view details)

Uploaded Python 3

File details

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

File metadata

  • Download URL: testfixtures-8.3.0.tar.gz
  • Upload date:
  • Size: 137.4 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/5.1.0 CPython/3.11.9

File hashes

Hashes for testfixtures-8.3.0.tar.gz
Algorithm Hash digest
SHA256 d4c0b84af2f267610f908009b50d6f983a4e58ade22c67bab6787b5a402d59c0
MD5 2fb494de4ba08d85e7b68f90cb296698
BLAKE2b-256 3b25d7e9d05f87e2ab84657a0dfb1f24fc295d542ac2eb221531d976ea4aa1ff

See more details on using hashes here.

File details

Details for the file testfixtures-8.3.0-py3-none-any.whl.

File metadata

  • Download URL: testfixtures-8.3.0-py3-none-any.whl
  • Upload date:
  • Size: 105.1 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/5.1.0 CPython/3.11.9

File hashes

Hashes for testfixtures-8.3.0-py3-none-any.whl
Algorithm Hash digest
SHA256 3d1e0e0005c4d6ac2a2ab27916704c6471047f0d2f78f2e54adf20abdacc7b10
MD5 96b2fb7886f99c0b7b5f0a7463017366
BLAKE2b-256 1a4e699671ba484b94bda0959b281ff59b24f728263befd13e060fa038ce3bc8

See more details on using hashes here.

Supported by

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