Fixed: test runner

This commit is contained in:
Ales Zoulek 2010-12-02 11:08:01 +01:00
parent 64bef7d88b
commit d833536f48
3 changed files with 8 additions and 5 deletions

View file

@ -33,6 +33,6 @@ setup(
],
packages=find_packages(exclude=['tests']),
include_package_data=True,
test_suite='tests.runtests.runtests',
test_suite='tests.runtests.main',
)

0
tests/__init__.py Normal file
View file

11
tests/runtests.py Normal file → Executable file
View file

@ -1,20 +1,23 @@
#!/usr/bin/env python
"""Borrowed from Carl Meyer's django-adminfiles."""
import os
import sys
parent = os.path.dirname(os.path.dirname(os.path.abspath(__file__)))
sys.path.insert(0, parent)
currentdir = os.path.dirname(os.path.abspath(__file__))
parentdir = os.path.dirname(currentdir)
sys.path.insert(0, parentdir)
sys.path.insert(0, currentdir)
os.environ['DJANGO_SETTINGS_MODULE'] = 'testproject.settings'
from django.test.simple import run_tests
def runtests():
def main():
failures = run_tests(['test_app'], verbosity=1, interactive=True)
sys.exit(failures)
if __name__ == '__main__':
runtests()
main()