Skip to content

Commit

Permalink
Handle changes in django-discover-runner 1.0.
Browse files Browse the repository at this point in the history
  • Loading branch information
ryankask committed Jun 19, 2013
1 parent 9ce7a9a commit 9ae0399
Show file tree
Hide file tree
Showing 5 changed files with 22 additions and 19 deletions.
26 changes: 18 additions & 8 deletions README.rst
Original file line number Diff line number Diff line change
@@ -1,12 +1,17 @@
django-discoverage
==================

Adds `coverage <http://nedbatchelder.com/code/coverage/>`_ to Carl Meyer and
Jannis Leidel's `django-discover-runner
Adds `coverage <http://nedbatchelder.com/code/coverage/>`_ to Django 1.6's test
runner and Carl Meyer and Jannis Leidel's `django-discover-runner
<https://github.com/jezdez/django-discover-runner>`_.

Inspired by `django-coverage <https://bitbucket.org/kmike/django-coverage/>`_.

django-discoverage works with Django 1.4 and above. If you are using Django 1.4
or 1.5, django-discover-runner is required and will be automatically
installed. That package backports the implementation of ``DiscoverRunner``
included in Django 1.6.

Quick usage
-----------

Expand All @@ -25,11 +30,11 @@ If you want to use the ``--no-coverage`` option, make sure you add
Detailed usage
--------------

One of the objectives of ``django-discover-runner`` is to allow the separation
of 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. The runner does this in two ways which are
discussed below.
One of the objectives of Django's ``DiscoverRunner`` (previously
``django-discover-runner``) is to allow the separation of 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. The runner does this in two ways which are discussed below.

First, it tries to infer which apps you are testing from the name of the package
in which the test's module lives. For example, if you have an app ``blog`` and
Expand Down Expand Up @@ -108,13 +113,18 @@ Settings
Change Log
----------

0.7.2 (2013-06-19)
~~~~~~~~~~~~~~~~~~

* Require django-discover-runner 1.0 which now backports Django 1.6's
implementation of ``DiscoverRunner``.

0.7.1 (2013-06-18)
~~~~~~~~~~~~~~~~~~

* Only install django-discover-runner if the version of Django installed is
lower than 1.6


0.7.0 (2013-06-05)
~~~~~~~~~~~~~~~~~~

Expand Down
2 changes: 1 addition & 1 deletion discoverage/__init__.py
Original file line number Diff line number Diff line change
@@ -1,3 +1,3 @@
from discoverage.runner import DiscoverageRunner

__version__ = '0.7.1'
__version__ = '0.7.2'
7 changes: 1 addition & 6 deletions discoverage/management/commands/test.py
Original file line number Diff line number Diff line change
@@ -1,12 +1,7 @@
from optparse import make_option

import django
from django.conf import settings

if django.VERSION[0] == 1 and django.VERSION[1] >= 6:
from django.core.management.commands.test import Command as TestCommand
else:
from discover_runner.management.commands.test import Command as TestCommand
from django.core.management.commands.test import Command as TestCommand


class Command(TestCommand):
Expand Down
5 changes: 2 additions & 3 deletions setup.py
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@ def get_version():
settings.configure()
from django.test.runner import DiscoverRunner
except ImportError:
install_requires.append('django-discover-runner>=0.4')
install_requires.append('django-discover-runner==1.0')

setup(
name='django-discoverage',
Expand All @@ -41,8 +41,7 @@ def get_version():
url='https://github.com/ryankask/django-discoverage',
packages=find_packages(),
install_requires=install_requires,
description=('Jannis Leidel and Carl Meyer\'s django-discover-runner '
'with coverage.'),
description=('Adds coverage to Django\'s DiscoverRunner.'),
long_description=get_readme(),
license='BSD',
classifiers=[
Expand Down
1 change: 0 additions & 1 deletion test_project/todo/settings.py
Original file line number Diff line number Diff line change
Expand Up @@ -35,6 +35,5 @@
)

TEST_RUNNER = 'discoverage.DiscoverageRunner'
TEST_DISCOVER_TOP_LEVEL = TEST_DISCOVER_ROOT = PROJECT_ROOT
COVERAGE_OMIT_MODULES = []
MODULE_NAME_APP_DISCOVERY = True

0 comments on commit 9ae0399

Please sign in to comment.