Skip to main content

Improved unittest test runner

Project description

Run Python unittests automatically. Re-run tests when source has changed. Try to make intelligent decisions about which tests to run.


In project directory with unittests:

$ autocheck discover -v

Accepts the same options as python -m unittest.


$ pip install autocheck

Optionally, for Growl support:

$ pip install gntp

Install watchdog kernel support according to

Django support

Tell django to use our test runner, in settings:

TEST_RUNNER = 'autocheck.contrib.django.TestSuiteRunner'

Or on the command line:

./ test --testrunner=autocheck.contrib.django.TestSuiteRunner

Run tests automatically whenever source has changed:

$ autocheck

autocheck tries to figure out if it runs in a django project (./ exists, contains DJANGO_SETTINGS_MODULE, django is importable). Additionally, if a file exists, DJANGO_SETTINGS_MODULE=test_settings is added to the environment.

Behind the scenes, there are two test runners for django, selected during import of autocheck.contrib.django.TestSuiteRunner:

  • autocheck.contrib.django.discoveryrunner.TestSuiteRunner for recent versions of django (>=1.6)
  • autocheck.contrib.django.testsuiterunner.TestSuiteRunner for older versions (<1.6)

The latter is not compatible with the old ./ test command, instead it tries to reproduce the interface of python -m unittest.

The other one is a thin wrapper around django’s DiscoverRunner, adding a few command line switches for our custom TestRunner.


Dump the test database with:

$ autocheck --stats

Or for flat output with:

$ autocheck --stats-flat


Build Status

Run in project directory:

$ python test

Run tests using our own test runner:

$ pip install -e .
$ pip install -r requirements/test.txt
$ python -m autocheck discover -v --once -s ./vows -t .

Tested against Python-2.6, 2.7, 3.3, 3.4, PyPy 2 and 3.


  • make autocheck.autorunner file pattern configurable
  • config file(s)
  • documentation for tags and tag expressions
  • documentation for autocheck command line flags
  • --help for autocheck command


This is free and unencumbered software released into the public domain.


Project details

Download files

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

Source Distribution

autocheck-0.2.7.tar.gz (91.2 kB view hashes)

Uploaded source

Built Distribution

autocheck-0.2.7-py2.py3-none-any.whl (101.1 kB view hashes)

Uploaded any

Supported by

AWS AWS Cloud computing Datadog Datadog Monitoring Facebook / Instagram Facebook / Instagram PSF Sponsor Fastly Fastly CDN Google Google Object Storage and Download Analytics Huawei Huawei PSF Sponsor Microsoft Microsoft PSF Sponsor NVIDIA NVIDIA PSF Sponsor Pingdom Pingdom Monitoring Salesforce Salesforce PSF Sponsor Sentry Sentry Error logging StatusPage StatusPage Status page