Run Python unittests automatically. Re-run tests when source has changed. Try to make intelligent decisions about which tests to run.
Example
In project directory with unittests:
$ autocheck discover -v
Accepts the same options as python -m unittest.
Installation
$ pip install autocheck
Optionally, for Growl support:
$ pip install gntp
Install watchdog kernel support according to https://pythonhosted.org/watchdog/installation.html.
Django support
Tell django to use our test runner, in settings:
TEST_RUNNER = 'autocheck.contrib.django.TestSuiteRunner'
Or on the command line:
./manage.py 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 (./manage.py exists, contains DJANGO_SETTINGS_MODULE, django is importable). Additionally, if a file test_settings.py 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 ./manage.py 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.
Statistics
Dump the test database with:
$ autocheck --stats
Or for flat output with:
$ autocheck --stats-flat
Tests
Run in project directory:
$ python setup.py 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.
TODO
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
License
This is free and unencumbered software released into the public domain.
see UNLICENSE
Metadata
Release files for autocheck 0.2.7
For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.
Source distribution (sdist)
| File | Size | Uploaded | |
|---|---|---|---|
| autocheck-0.2.7.tar.gz | 91.2 kB | Details |
Built distribution (wheel)
| File | Interpreter | ABI | Platform | Reset |
|---|---|---|---|---|
| autocheck-0.2.7-py2.py3-none-any.whl | Python 2, Python 3 | none | any | Details |
Total release size: 192.2 kB
Release files / autocheck-0.2.7.tar.gz
| Download URL | autocheck-0.2.7.tar.gz |
|---|---|
| Size | 91.2 kB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
ff0ff3eb97f656c19428328b3404e06bfc8a706ef2ffa47d5d962589b62d9fa7
|
|
BLAKE2b-256 checksum How to use checksums |
89685ff5f77b584310d5cf6a29c5db5b52078ed6d0cc31768d3ff0c7f7dd708b
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
Release files / autocheck-0.2.7-py2.py3-none-any.whl
| Download URL | autocheck-0.2.7-py2.py3-none-any.whl |
|---|---|
| Size | 101.1 kB |
| Tags | Python 2 Python 3 |
|
SHA-256 checksum How to use checksums |
c79b193ed725a1fd6afe78cbf3be5adc553a3c02a3794cec9ec8b7c72a133e96
|
|
BLAKE2b-256 checksum How to use checksums |
d8228f03136b877bd43ebf8e98bf7be704de36f1b93f1fe3fe3bbeca3c5d4132
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |