Skip to main content

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

Project description

Docs PyPI Git CircleCI

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

9.1.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-9.1.0.tar.gz (88.6 kB view details)

Uploaded Source

Built Distribution

testfixtures-9.1.0-py3-none-any.whl (106.3 kB view details)

Uploaded Python 3

File details

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

File metadata

  • Download URL: testfixtures-9.1.0.tar.gz
  • Upload date:
  • Size: 88.6 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.1.0 CPython/3.11.13

File hashes

Hashes for testfixtures-9.1.0.tar.gz
Algorithm Hash digest
SHA256 517e9cf353942723533ae1100ca45dd27fe0785c3ad2765075f5cb1cbce01482
MD5 47a6be41dc5754459f723b5e4d208231
BLAKE2b-256 76371084db985a7bda417f012570f369d18a6b4afbc59bc423908d0219c38188

See more details on using hashes here.

File details

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

File metadata

  • Download URL: testfixtures-9.1.0-py3-none-any.whl
  • Upload date:
  • Size: 106.3 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.1.0 CPython/3.11.13

File hashes

Hashes for testfixtures-9.1.0-py3-none-any.whl
Algorithm Hash digest
SHA256 2f4786194cd92b0b2f2f2d29f72346bdd0191baae58532532b7bfcaecd59ba02
MD5 d8c14f5cadbc47bf803e892e99b092eb
BLAKE2b-256 f3b6c60e4a39c6bc717e7c08d1428e2bf53e735bbb020563c91d7f272aa552b1

See more details on using hashes here.

Supported by

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