Skip to content

Commit

Permalink
Import DiscoverRunner for django 1.8 support
Browse files Browse the repository at this point in the history
This is the same way that django-nose imports DiscoverRunner and
falls back to DjangoTestSuiteRunner on older versions of django.

refs jpellerin#2
  • Loading branch information
nikolas committed Apr 6, 2015
1 parent b2297ed commit 6ae83af
Showing 1 changed file with 6 additions and 1 deletion.
7 changes: 6 additions & 1 deletion djnose2/runner.py
Original file line number Diff line number Diff line change
Expand Up @@ -4,13 +4,18 @@
import logging

from django.test import simple
try:
from django.test.runner import DiscoverRunner
except ImportError:
# Django < 1.8
from django.test.simple import DjangoTestSuiteRunner as DiscoverRunner
from nose2.main import discover


log = logging.getLogger(__name__)


class TestRunner(simple.DjangoTestSuiteRunner):
class TestRunner(DiscoverRunner):

err_count = 0
_hooks = ('startTestRun', 'reportFailure', 'reportError')
Expand Down

0 comments on commit 6ae83af

Please sign in to comment.