Skip to content

Commit

Permalink
make tests work with setup.py test and move test in one location
Browse files Browse the repository at this point in the history
  • Loading branch information
trbs committed Jul 20, 2012
1 parent 529a487 commit 8b0850e
Show file tree
Hide file tree
Showing 5 changed files with 10 additions and 8 deletions.
1 change: 1 addition & 0 deletions django_extensions/tests/__init__.py
Original file line number Diff line number Diff line change
@@ -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
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@

import subprocess
import sys
import unittest2 as unittest
from django.utils import unittest


class PrintSettingsTests(unittest.TestCase):
Expand Down
11 changes: 6 additions & 5 deletions run_tests.py
100644 → 100755
Original file line number Diff line number Diff line change
@@ -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',
Expand All @@ -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__':
Expand Down
4 changes: 2 additions & 2 deletions setup.py
Original file line number Diff line number Diff line change
Expand Up @@ -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',
Expand Down
Empty file removed tests/__init__.py
Empty file.

0 comments on commit 8b0850e

Please sign in to comment.