A test coverage reporting tool that utilizes Ned Batchelder's excellent coverage.py to show how much of your code is exercised with your tests.
- Django 1.2 and above. For earlier versions, try version 1.0.3 of django-coverage.
- coverage.py
- Place the entire
django_coverage
app in your third-party apps directory. - Update your
settings.INSTALLED_APPS
to includedjango_coverage
. - Include test coverage specific settings in your own settings file. See
settings.py
for more detail.
Once you've completed all the steps, you'll have a new custom command available to you via manage.py test_coverage
. It works just like manage.py test
.
You don't have to install django_coverage
as an app if you don't want to. You can simply use the test runner if you like.
- Update
settings.TEST_RUNNER = 'django_coverage.coverage_runner.CoverageRunner'
- Include test coverage specific settings in your own settings file. See
settings.py
for more detail. - Run
manage.py test
like you normally do.
And that's it.