Skip to main content

Jannis Leidel and Carl Meyer's django-discover-runner with coverage.

Project description

Adds coverage to Jannis Leidel and Carl Meyer’s django-discover-runner.

Inspired by django-coverage.

Usage

One of the objectives of django-discover-runner is to allow separating a Django app’s tests from the code it’s testing. Since tests no longer reside in an app, django-discoverage needs a different way to know which apps to include in the coverage report. It currently collects apps (packages) by looking for an iterable (named by default TESTS_APPS) in three places:

  1. On a TestCase instance in the suite.

  2. In the TestCase subclass’s module (test_*.py by default).

  3. In the TestCase subclass’s immediate package. If MyTestCase is in the package tests.myapp.test_views, the runner inspects tests.myapp. It does not currently traverse parent packages.

Let’s say you had the following test module, tests.blog.test_views:

TESTS_APPS = ('blog',)

class MyTestCase(TestCase):
    TESTS_APPS = ('mycoolapp', 'myproject.anothercoolapp')
    ...

All modules in the apps blog, mycoolapp, and myproject.anothercoolapp will be included in the report along with any apps listed in test.blog.TESTS_APPS.

Modules specified in OMIT_MODULES will not, however, appear in the report.

Settings

TESTED_APPS_VAR_NAME

The name of the iterable django-discoverage looks for in the three places listed above.

OMIT_MODULES

Modules not to be traced by coverage. See the coverage API documentation for more details.

TODO

  • Add more settings to control coverage

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

django-discoverage-0.3.1.tar.gz (4.0 kB view hashes)

Uploaded Source

Supported by

AWS AWS Cloud computing and Security Sponsor Datadog Datadog Monitoring Fastly Fastly CDN Google Google Download Analytics Microsoft Microsoft PSF Sponsor Pingdom Pingdom Monitoring Sentry Sentry Error logging StatusPage StatusPage Status page