File: runtests.py

package info (click to toggle)
python-django-pyscss 2.0.2-4~bpo8%2B1
  • links: PTS, VCS
  • area: main
  • in suites: jessie-backports
  • size: 260 kB
  • sloc: python: 416; makefile: 35
file content (20 lines) | stat: -rw-r--r-- 629 bytes parent folder | download | duplicates (6)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
#!/usr/bin/env python
import os
import sys
os.environ.setdefault("DJANGO_SETTINGS_MODULE", "testproject.testproject.settings")

import django
if hasattr(django, 'setup'):
    django.setup()

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


def runtests():
    # Stolen from django/core/management/commands/test.py
    TestRunner = get_runner(settings)
    test_runner = TestRunner(verbosity=1, interactive=True)
    # failures = test_runner.run_tests(['tests.test_scss.FindersImportTest.test_relative_import_with_filename'])
    failures = test_runner.run_tests(['tests'])
    sys.exit(bool(failures))