django-testcoverage 0.1.3
Code coverage reports for Django unit testing framework
Downloads ↓ | Package Documentation
GitHub repository: http://github.com/mikoskay/django-testcoverage
Summary
django-testcoverage is a package providing code coverage reports for built-in Django unit testing framework.
Requirements
The only requirement of django-testcoverage is coverage package by Ned Batchelder. Of course you're going to need Django itself , but if you won't have it, why would you even read this... Required Django version is 1.2 or newer.
All the requirements will be installed automatically if you use pip or easy_install.
Installation
Just:
$ pip install django-testcoverage
or:
$ easy_install django-testcoverage
All the requirements (Django and coverage), if not present, will be installed automatically.
Now add a following line to your settings.py:
TEST_RUNNER = 'testcoverage.test_runner.TestCoverageTestRunner'
And you're ready to go!
Usage
Coverage reports are active for default, so you can just run your test as always:
$ ./manage.py test
This will print the coverage report for all Python modules in your project (including Django's!) which is almost never what you want. You can specify which applications should be tested:
$ ./manage.py test myapp secondapp
If you do so, coverage reports will be computed only for listed apps. You can also globally specify which packages should be included in your coverage reports using adding TESTCOVERAGE_APPS to your settings.py, like:
TESTCOVERAGE_APPS = (
'somepackage.foo',
'myapp',
'secondapp',
)
Then you can run tests for all applications, but only these listed in TESTCOVERAGE_APPS will be included in the coverage report.
You can also turn off coverage reporting by adding to your settings:
TESTCOVERAGE_ACTIVE = False
Author and license
Copyright (c) 2011 Mikołaj Siedlarek <mikolaj.siedlarek at gmail.com>
Distributed on terms of 3-clause BSD license (AKA New BSD License or Modified BSD License). Do you know the Django BSD license? It's same.
For details conslut LICENSE.txt file.
| File | Type | Py Version | Uploaded on | Size | # downloads |
|---|---|---|---|---|---|
| django-testcoverage-0.1.3.tar.gz (md5) | Source | 2011-03-24 | 3KB | 525 | |
- Author: MikoÅaj Siedlarek
- Documentation: django-testcoverage package documentation
- Home Page: https://github.com/mikoskay/django-testcoverage
- Categories
- Package Index Owner: Mikoskay
- DOAP record: django-testcoverage-0.1.3.xml
