Skip to main content

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

Project description

Docs PyPI Git

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

Download files

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

Source Distribution

testfixtures-12.0.0.tar.gz (177.3 kB view details)

Uploaded Source

Built Distribution

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

testfixtures-12.0.0-py3-none-any.whl (61.4 kB view details)

Uploaded Python 3

File details

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

File metadata

  • Download URL: testfixtures-12.0.0.tar.gz
  • Upload date:
  • Size: 177.3 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/6.1.0 CPython/3.13.12

File hashes

Hashes for testfixtures-12.0.0.tar.gz
Algorithm Hash digest
SHA256 95f3a7824e104be2f6673fea59f9260ed6972b28064240e317c771fc13ab4268
MD5 125825798c9e9e754ac7695317272226
BLAKE2b-256 6a7ed2be2e9c9367bcf13b2aab7defd6c075e4f87c3741d18abadf413efbb5c5

See more details on using hashes here.

Provenance

The following attestation bundles were made for testfixtures-12.0.0.tar.gz:

Publisher: release.yml on simplistix/testfixtures

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

File details

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

File metadata

  • Download URL: testfixtures-12.0.0-py3-none-any.whl
  • Upload date:
  • Size: 61.4 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/6.1.0 CPython/3.13.12

File hashes

Hashes for testfixtures-12.0.0-py3-none-any.whl
Algorithm Hash digest
SHA256 db6ae636369cd31f40899344a2dfa9e50da0e0e80b63128f82fbf60e9a118f2b
MD5 eb1bd42d1fc572d14777a646dcdf293a
BLAKE2b-256 78cdcbee7ae737c5f3cce2eb762b152d1e2053c2c2d4f0ebb8dc663a71168110

See more details on using hashes here.

Provenance

The following attestation bundles were made for testfixtures-12.0.0-py3-none-any.whl:

Publisher: release.yml on simplistix/testfixtures

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

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