Commits

Matthew Schinckel committed a5117fd

Ensure tests can run.

Update acceptable versions.

References #16.

  • Participants
  • Parent commits 20f02b3

Comments (0)

Files changed (3)

 MANIFEST
 dist/
 .tox
+.coverage/
 import doctest
 import django
 
-BASE_PATH = os.path.dirname(__file__) + 'timedelta/'
+BASE_PATH = os.path.dirname(__file__)
 
 def main(db_engine='sqlite3'):
     """
         'django.contrib.auth',
         'django.contrib.contenttypes',
         'timedelta',
+        'django_coverage',
     )
     global_settings.DATABASES = {
         'default': {
     global_settings.STATIC_ROOT = global_settings.MEDIA_ROOT
     
     global_settings.SECRET_KEY = '334ebe58-a77d-4321-9d01-a7d2cb8d3eea'
-    global_settings.TEST_RUNNER = 'django_coverage.coverage_runner.CoverageRunner'
+    global_settings.COVERAGE_REPORT_HTML_OUTPUT_DIR = os.path.join(BASE_PATH, '.coverage')
+    global_settings.COVERAGE_USE_STDOUT = True
     
-    from django.test.utils import get_runner
-    test_runner = get_runner(global_settings)
+    if os.environ.get('COVERAGE', None):
+        from django_coverage import coverage_runner
+        test_runner = coverage_runner.CoverageRunner
+    else:
+        from django.test.utils import get_runner
+        test_runner = get_runner(global_settings)
 
     test_runner = test_runner()
     failures = test_runner.run_tests(['timedelta'])
 [tox]
-envlist = py26,py27,py32,pypy,py27-django-1.4,py27-django-1.5,py27-django-trunk
+envlist = py26,py27,py33,pypy,py27-django-1.4,py27-django-1.5,py27-django-1.6,py27-django-1.7,py27-django-trunk
 [base]
 deps=
   coverage
 deps= django>=1.5,<1.6
   {[base]deps}
 
+[testenv:py27-django-1.6]
+deps= django>=1.6,<1.7
+  {[base]deps}
+
+[testenv:py27-django-1.7]
+deps= https://www.djangoproject.com/download/1.7b2/tarball/
+  {[base]deps}
+
 [testenv:py27-django-trunk]
 deps= git+git://github.com/django/django.git
   {[base]deps}