File: run_tests.py

package info (click to toggle)
django-cors-headers 1.1.0-2
  • links: PTS, VCS
  • area: main
  • in suites: stretch
  • size: 168 kB
  • ctags: 133
  • sloc: python: 507; makefile: 7
file content (24 lines) | stat: -rw-r--r-- 589 bytes parent folder | download
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
# -*- coding: utf-8 -*-
import os
import sys
import django

os.environ['DJANGO_SETTINGS_MODULE'] = 'test_settings'
test_dir = os.path.dirname(os.path.dirname(os.path.abspath(__file__)))
sys.path.insert(0, test_dir)

from django.test.utils import get_runner
from django.conf import settings as s

if django.VERSION > (1, 7, 0):
    django.setup()


def run_tests():
    TestRunner = get_runner(s)
    test_runner = TestRunner(verbosity=1, interactive=True)
    failuers = test_runner.run_tests(['corsheaders.tests'])
    sys.exit(bool(failuers))

if __name__ == '__main__':
    run_tests()