Add test runner for use with python setup.py test

This commit is contained in:
Tyson Clugg 2015-12-14 11:47:13 +11:00
parent 0109f3372d
commit b521317c77

View file

@ -0,0 +1,17 @@
# This file mainly exists to allow `python setup.py test` to work.
import os
import sys
import dddp
import django
from django.test.utils import get_runner
from django.conf import settings
def run_tests():
os.environ['DJANGO_SETTINGS_MODULE'] = 'dddp.test.test_project.settings'
dddp.greenify()
django.setup()
test_runner = get_runner(settings)()
failures = test_runner.run_tests(['dddp'])
sys.exit(bool(failures))