Permalink
Browse files

Make python setup.py test actually run the tests. Do this by includin…

…g a runtests.py file in the test_project. There is probably a better way to do this, but it works.
  • Loading branch information...
ericholscher committed Jun 30, 2009
1 parent d9c1d67 commit b18893ac7230b4689f9be19ce3f8fbfd13745324
Showing with 23 additions and 2 deletions.
  1. +3 −2 setup.py
  2. +20 −0 test_project/runtests.py
View
@@ -9,5 +9,6 @@
description = "A package to help testing in Django",
url = "http://github.com/ericholscher/django-test-utils/tree/master",
download_url='http://www.github.com/ericholscher/django-test-utils/tarball/0.3.0',
include_package_data = True
)
test_suite = "test_project.runtests.runtests",
include_package_data = True,
)
View
@@ -0,0 +1,20 @@
#This file mainly exists to allow python setup.py test to work.
import os, sys
os.environ['DJANGO_SETTINGS_MODULE'] = 'test_project.settings'
test_dir = os.path.dirname(__file__)
sys.path.insert(0, test_dir)
from django.test.utils import get_runner
from django.conf import settings
def runtests():
verbosity = 1
interactive = True
test_runner = get_runner(settings)
failures = test_runner([], verbosity=verbosity, interactive=interactive)
sys.exit(failures)
if __name__ == '__main__':
runtests()

0 comments on commit b18893a

Please sign in to comment.