Browse Source

Refactor tests so python setup.py test works correctly

David Cramer 14 years ago
parent
commit
931ef590a2
4 changed files with 13 additions and 20 deletions
  1. 2 1
      .gitignore
  2. 0 0
      sentry/runtests.py
  3. 2 2
      sentry/tests/__init__.py
  4. 9 17
      setup.py

+ 2 - 1
.gitignore

@@ -8,4 +8,5 @@ pip-log.txt
 /example_project/local_settings.py
 /docs/html
 /docs/doctrees
-/sentry_index
+sentry/sentry_index/
+*.egg

+ 0 - 0
runtests.py → sentry/runtests.py


+ 2 - 2
sentry/tests/__init__.py

@@ -1,2 +1,2 @@
-from tests import *
-from models import *
+from sentry.tests.tests import *
+from sentry.tests.models import *

+ 9 - 17
setup.py

@@ -2,21 +2,17 @@
 
 try:
     from setuptools import setup, find_packages
-    from setuptools.command.test import test
 except ImportError:
     from ez_setup import use_setuptools
     use_setuptools()
     from setuptools import setup, find_packages
-    from setuptools.command.test import test
-
-
-class mytest(test):
-    def run(self, *args, **kwargs):
-        from runtests import runtests
-        runtests()
-        # Upgrade().run(dist=True)
-        # test.run(self, *args, **kwargs)
 
+tests_require = [
+    'django',
+    'django-celery',
+    'south',
+    # also requires the disqus fork of haystack
+]
 
 setup(
     name='django-sentry',
@@ -32,14 +28,10 @@ setup(
         'django-indexer==0.2.1',
         'uuid',
     ],
-    tests_require=[
-        'django',
-        'django-celery',
-        # also requires the disqus fork of haystack
-    ],
-    test_suite = 'sentry.tests',
+    tests_require=tests_require,
+    extras_require={'test': tests_require},
+    test_suite='sentry.runtests.runtests',
     include_package_data=True,
-    cmdclass={"test": mytest},
     classifiers=[
         'Framework :: Django',
         'Intended Audience :: Developers',