Permalink
Browse files

updated testrunner

  • Loading branch information...
1 parent 662946b commit e9f392e96a8366ece7bad6bf6adedb59ed52e0d4 Shaun Sephton committed Sep 2, 2011
Showing with 12 additions and 33 deletions.
  1. +0 −21 runtests.py
  2. +5 −12 setup.py
  3. +7 −0 test_settings.py
View
21 runtests.py
@@ -1,21 +0,0 @@
-import sys
-from django.conf import settings
-
-if not settings.configured:
- settings.configure(
- DATABASE_ENGINE='sqlite3',
- INSTALLED_APPS=[
- 'section',
- ],
- ROOT_URLCONF='section.tests.urls',
- )
-
-from django.test.simple import run_tests
-
-
-def runtests():
- failures = run_tests(('section',), verbosity=1, interactive=True)
- sys.exit(failures)
-
-if __name__ == '__main__':
- runtests()
View
17 setup.py
@@ -1,16 +1,10 @@
from setuptools import setup, find_packages
from setuptools.command.test import test
-
-class TestRunner(test):
- def run(self, *args, **kwargs):
- if self.distribution.install_requires:
- self.distribution.fetch_build_eggs(\
- self.distribution.install_requires)
- if self.distribution.tests_require:
- self.distribution.fetch_build_eggs(self.distribution.tests_require)
- from runtests import runtests
- runtests()
+def run_tests(self):
+ from setuptest.runtests import runtests
+ return runtests(self)
+test.run_tests = run_tests
setup(
name='django-section',
@@ -24,12 +18,11 @@ def run(self, *args, **kwargs):
packages=find_packages(),
include_package_data=True,
test_suite='section.tests',
- cmdclass={'test': TestRunner},
install_requires=[
'django-snippetscream',
],
tests_require=[
- 'django',
+ 'django-setuptest',
],
classifiers=[
"Programming Language :: Python",
View
7 test_settings.py
@@ -0,0 +1,7 @@
+DATABASE_ENGINE = 'sqlite3'
+
+INSTALLED_APPS = [
+ 'section',
+]
+
+ROOT_URLCONF = 'section.tests.urls'

0 comments on commit e9f392e

Please sign in to comment.