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.

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.

Source Distribution

testfixtures-7.2.2.tar.gz (133.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-7.2.2-py3-none-any.whl (103.1 kB view details)

Uploaded Python 3

File details

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

File metadata

  • Download URL: testfixtures-7.2.2.tar.gz
  • Upload date:
  • Size: 133.8 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/4.0.2 CPython/3.9.18

File hashes

Hashes for testfixtures-7.2.2.tar.gz
Algorithm Hash digest
SHA256 80774aecb0249458275ab783f53093fbe75795ff2b3218d22ce3fff0a12c4da6
MD5 6e65c81f3126e2c9c7c406b283a41251
BLAKE2b-256 f2364ef4a0be7d5dc4731e8be6dee85b046422519fa4eb83882a5d84776a8e67

See more details on using hashes here.

File details

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

File metadata

  • Download URL: testfixtures-7.2.2-py3-none-any.whl
  • Upload date:
  • Size: 103.1 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/4.0.2 CPython/3.9.18

File hashes

Hashes for testfixtures-7.2.2-py3-none-any.whl
Algorithm Hash digest
SHA256 c72adaf9c7b06882b0ea379dd8159422ca2be0205eedc7c3fee0074cd32f45fa
MD5 6c1000bc2a50d407b6cd06fdd093416a
BLAKE2b-256 ebee21b092192a5c3c01ca8e4bf4afdacc6cd1be2da7bc0a37bffa59212b2843

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