Skip to content
Back to top
View this page

# Installation Instructions

If you want to experiment with testfixtures, the easiest way to install it is to do the following in a virtualenv:

    pip install testfixtures

If you are using uv, add testfixtures to your project’s dev dependency group:

    [dependency-groups]
    dev = [
        "testfixtures",
    ]

If you are using conda, testfixtures can be installed as follows:

    conda install -c conda-forge testfixtures

For legacy projects using setuptools with `setup.py`, you should do one of the following:

- Specify `testfixtures` in the `tests_require` parameter of your package’s call to `setup` in `setup.py`.

- Add an `extra_requires` parameter in your call to `setup` as follows:

      setup(
          # other stuff here
          extras_require=dict(
              test=['testfixtures'],
          )
      )

## Optional Dependencies

Several optional extras are provided for specific frameworks and tools. While you don’t have to specify these extras, doing so will ensure compatibility with the version of these packages that your project is using:

- `[django]`: Django ORM integration and comparison helpers. See Testing with Django.

- `[twisted]`: Twisted framework logging support. See Testing with Twisted.

- `[sybil]`: Sybil documentation testing framework. See Using with Sybil.

- `[mock-backport]`: See documentation on which mock to use.

- `[yaml]`: YAML format support for `TempDir`. See Distribution files.

- `[toml]`: TOML format writing support for `TempDir`. See Distribution files.

Multiple extras can be installed together, for example: `testfixtures[django,twisted]`.