Skip to content

Commit

Permalink
Update test runner
Browse files Browse the repository at this point in the history
  • Loading branch information
paltman committed Jul 2, 2014
1 parent 0ce8866 commit bca2f16
Showing 1 changed file with 8 additions and 10 deletions.
18 changes: 8 additions & 10 deletions runtests.py
Original file line number Diff line number Diff line change
Expand Up @@ -35,21 +35,19 @@ def runtests(*test_args):
if hasattr(django, "setup"):
django.setup()

if not test_args:
test_args = ["tests"]

parent = os.path.dirname(os.path.abspath(__file__))
sys.path.insert(0, parent)

try:
from django.test.simple import DjangoTestSuiteRunner as TestRunner
if not test_args:
test_args = ["tests"]
from django.test.runner import DiscoverRunner
runner_class = DiscoverRunner
test_args = ["wiki.tests"]
except ImportError:
from django.test.runner import DiscoverRunner as TestRunner
if not test_args:
test_args = ["wiki.tests"]
failures = TestRunner(
from django.test.simple import DjangoTestSuiteRunner
runner_class = DjangoTestSuiteRunner
test_args = ["tests"]

failures = runner_class(
verbosity=1, interactive=True, failfast=False).run_tests(test_args)
sys.exit(failures)

Expand Down

0 comments on commit bca2f16

Please sign in to comment.