forked from iMerica/dj-rest-auth
-
Notifications
You must be signed in to change notification settings - Fork 1
/
runtests.py
26 lines (19 loc) · 657 Bytes
/
runtests.py
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
# This file mainly exists to allow python setup.py test to work.
# flake8: noqa
import os
import sys
import django
from django.conf import settings
from django.test.utils import get_runner
os.environ['DJANGO_SETTINGS_MODULE'] = 'dj_rest_auth.tests.settings'
test_dir = os.path.join(os.path.dirname(__file__), 'dj_rest_auth')
sys.path.insert(0, test_dir)
def runtests():
TestRunner = get_runner(settings)
test_runner = TestRunner(verbosity=1, interactive=True)
if hasattr(django, 'setup'):
django.setup()
failures = test_runner.run_tests(['dj_rest_auth'])
sys.exit(bool(failures))
if __name__ == '__main__':
runtests()