Fix run_tests.py script and travis environment

This commit is contained in:
Will Kahn-Greene 2013-06-08 09:17:54 -04:00
Родитель b6a58cb7c3
Коммит 66376a3a21
2 изменённых файлов: 9 добавлений и 13 удалений

Просмотреть файл

@ -14,7 +14,7 @@ notifications:
install:
- virtualenv .
- ./bin/pip install -r requirements-dev.txt
- "[ $DJANGO = true ] && bin/pip install -r requirements-django.txt || echo"
- "[ $DJANGO = true ] && bin/pip install -r requirements-dev.txt || echo"
script:
- ./bin/python run_tests.py

Просмотреть файл

@ -9,19 +9,15 @@ import nose
# Set up the environment for our test project.
ROOT = os.path.abspath(os.path.dirname(__file__))
try:
# import to check for the existence of Django
import django
os.environ.update({'DJANGO_SETTINGS_MODULE': 'test_settings'})
sys.path.insert(0, ROOT)
# import to check for the existence of Django
import django
os.environ.update({'DJANGO_SETTINGS_MODULE': 'test_settings'})
sys.path.insert(0, ROOT)
# This can't be imported until after we've fiddled with the
# environment.
from django.test.utils import setup_test_environment
setup_test_environment()
except ImportError:
# If django is not found, the Django tests will be skipped, so this is ok.
pass
# This can't be imported until after we've fiddled with the
# environment.
from django.test.utils import setup_test_environment
setup_test_environment()
# Run nose.
#