File: runtests.py

package info (click to toggle)
python-django-threadedcomments 0.5.3-4
  • links: PTS, VCS
  • area: main
  • in suites: wheezy
  • size: 804 kB
  • sloc: python: 2,521; makefile: 13
file content (17 lines) | stat: -rw-r--r-- 584 bytes parent folder | download
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
import sys
sys.path.append('..')

import os
# Make a backup of DJANGO_SETTINGS_MODULE environment variable to restore later.
backup = os.environ.get('DJANGO_SETTINGS_MODULE', '')
os.environ['DJANGO_SETTINGS_MODULE'] = 'settings'

from django.test.simple import DjangoTestSuiteRunner

if __name__ == "__main__":
    runner = DjangoTestSuiteRunner(verbosity=9)
    failures = runner.run_tests(['threadedcomments',])
    if failures:
        sys.exit(failures)
    # Reset the DJANGO_SETTINGS_MODULE to what it was before running tests.
    os.environ['DJANGO_SETTINGS_MODULE'] = backup