Skip to main content
Help us improve Python packaging – donate today!

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

Release history Release notifications

History Node

6.0.1

History Node

6.0.0

History Node

5.4.0

History Node

5.3.1

History Node

5.3.0

History Node

5.2.0

History Node

5.1.1

History Node

5.1.0

History Node

5.0.0

History Node

4.14.3

History Node

4.14.2

History Node

4.14.1

History Node

4.14.0

History Node

4.13.5

History Node

4.13.4

History Node

4.13.3

History Node

4.13.1

History Node

4.13.0

History Node

4.12.0

History Node

4.11.0

History Node

4.10.1

History Node

4.10.0

History Node

4.9.1

History Node

4.9.0

History Node

4.8.0

History Node

4.7.0

History Node

4.6.0

History Node

4.5.1

History Node

4.5.0

History Node

4.4.0

History Node

4.3.3

History Node

4.3.2

History Node

4.3.0

History Node

4.2.0

History Node

4.1.2

History Node

4.1.1

History Node

4.1.0

History Node

4.0.2

History Node

4.0.1

History Node

4.0.0

This version
History Node

3.1.0

History Node

3.0.2

History Node

3.0.1

History Node

3.0.0

History Node

2.3.5

History Node

2.3.4

History Node

2.3.3

History Node

2.3.2

History Node

2.3.1

History Node

2.3.0

History Node

2.2.0

History Node

2.1.0

History Node

2.0.1

History Node

2.0.0

History Node

1.12.0

History Node

1.11.3

History Node

1.11.2

History Node

1.11.1

History Node

1.11.0

History Node

1.10.0

History Node

1.9.2

History Node

1.9.1

History Node

1.9.0

History Node

1.8.0

History Node

1.7.0

History Node

1.6.3

History Node

1.6.2

History Node

1.6.1

History Node

1.6.0

History Node

1.5.4

History Node

1.5.3

History Node

1.5.2

History Node

1.5.1

History Node

1.5.0

History Node

1.4.0

History Node

1.3.1

History Node

1.3.0

History Node

1.2.0

History Node

1.1.0

History Node

1.0.0

History Node

1.8.0dev-r4464

Supported by

Elastic Elastic Search Pingdom Pingdom Monitoring Google Google BigQuery Sentry Sentry Error logging CloudAMQP CloudAMQP RabbitMQ AWS AWS Cloud computing Fastly Fastly CDN DigiCert DigiCert EV certificate StatusPage StatusPage Status page