django-treebeard / docs / tests.rst

Running the Test Suite

django-treebeard includes a comprehensive test suite. It is highly recommended that you run and update the test suite when you send patches.


You will need pytest to run the test suite.

To run the test suite:

$ py.test

You can use all the features and plugins of pytest this way.

By default the test suite will run using a sqlite3 database in RAM, but you can change this setting environment variables:


django-treebeard uses tox to run the test suite in all the supported environments:

  • py24-dj12-sqlite
  • py24-dj12-mysql
  • py24-dj12-postgres
  • py24-dj13-sqlite
  • py24-dj13-mysql
  • py24-dj13-postgres
  • py25-dj12-sqlite
  • py25-dj12-mysql
  • py25-dj12-postgres
  • py25-dj13-sqlite
  • py25-dj13-mysql
  • py25-dj13-postgres
  • py26-dj12-sqlite
  • py26-dj12-mysql
  • py26-dj12-postgres
  • py26-dj13-sqlite
  • py26-dj13-mysql
  • py26-dj13-postgres
  • py27-dj12-sqlite
  • py27-dj12-mysql
  • py27-dj12-postgres
  • py27-dj13-sqlite
  • py27-dj13-mysql
  • py27-dj13-postgres

This means that the test suite will run 24 times to test every environment supported by django-treebeard. This takes a long time. If you want to test only one or a few environments, please use the -e option in tox, like:

$ tox -e py27-dj13-postgres