Permalink
Browse files

make tests work with setup.py test and move test in one location

  • Loading branch information...
1 parent 529a487 commit 8b0850e924357a997be13391f13b27aa03a20330 @trbs trbs committed Jul 20, 2012
@@ -1,5 +1,6 @@
from django.db import models
from django_extensions.tests.test_dumpscript import DumpScriptTests
+from django_extensions.tests.test_print_settings import PrintSettingsTests
from django_extensions.tests.utils import UTILS_TRUNCATE_LETTERS_TESTS
from django_extensions.tests.utils import UTILS_UUID_TESTS
from django_extensions.tests.json_field import JsonFieldTest
@@ -5,7 +5,7 @@
import subprocess
import sys
-import unittest2 as unittest
+from django.utils import unittest
class PrintSettingsTests(unittest.TestCase):
View
11 run_tests.py 100644 → 100755
@@ -1,14 +1,13 @@
-# from http://www.travisswicegood.com/2010/01/17/django-virtualenv-pip-and-fabric/
-
+import sys
from django.conf import settings
from django.core.management import call_command
def main():
# Dynamically configure the Django settings with the minimum necessary to
# get Django running tests
settings.configure(
- INSTALLED_APPS=[
+ INSTALLED_APPS = [
'django.contrib.auth',
'django.contrib.contenttypes',
'django.contrib.admin',
@@ -30,8 +29,10 @@ def main():
TEMPLATE_DEBUG = True
)
- # Fire off the tests
- call_command('test', 'django_extensions')
+ from django.test.utils import get_runner
+ test_runner = get_runner(settings)(verbosity=2, interactive=True)
+ failures = test_runner.run_tests(['django_extensions'])
+ sys.exit(failures)
if __name__ == '__main__':
View
@@ -87,8 +87,8 @@ def fullsplit(path, result=None):
packages=packages,
cmdclass=cmdclasses,
data_files=data_files,
- tests_require=['Django', 'unittest2'],
- test_suite='unittest2.collector',
+ tests_require=['Django'],
+ test_suite='run_tests.main',
classifiers=[
'Development Status :: 4 - Beta',
'Development Status :: 5 - Production/Stable',
View
No changes.

0 comments on commit 8b0850e

Please sign in to comment.