Skip to content

Commit

Permalink
Update travis settings
Browse files Browse the repository at this point in the history
  • Loading branch information
paltman committed Jul 20, 2014
1 parent 334d6be commit 6782099
Show file tree
Hide file tree
Showing 5 changed files with 57 additions and 88 deletions.
4 changes: 4 additions & 0 deletions .coveragerc
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
[run]
source = notification
omit = notification/tests/*
branch = 1
49 changes: 0 additions & 49 deletions .pylintrc

This file was deleted.

16 changes: 9 additions & 7 deletions .travis.yml
Original file line number Diff line number Diff line change
Expand Up @@ -2,13 +2,15 @@ language: python
python:
- "2.7"
env:
- DJANGO=1.4.8
- DJANGO=1.5.4
- DJANGO=1.4.13
- DJANGO=1.5.8
- DJANGO=1.6.5
install:
- pip install -q Django==$DJANGO
- pip install -q django-nose
- pip install -q flake8
- pip install -e .
script:
- pip install -q Django==$DJANGO flake8 coverage coveralls
before_script:
- flake8 --max-line-length=100 --max-complexity=10 --statistics --benchmark notification
- python runtests.py
script:
- coverage run runtests.py
after_script:
- coveralls
56 changes: 40 additions & 16 deletions runtests.py
Original file line number Diff line number Diff line change
@@ -1,16 +1,13 @@
#!/usr/bin/env python
import os
import sys

import django

from django.conf import settings

settings.configure(
DEBUG=True,
USE_TZ=True,
DATABASES={
"default": {
"ENGINE": "django.db.backends.sqlite3",
}
},
ROOT_URLCONF="notification.urls",

DEFAULT_SETTINGS = dict(
INSTALLED_APPS=[
"django.contrib.auth",
"django.contrib.contenttypes",
Expand All @@ -19,15 +16,42 @@
"notification",
"notification.tests",
],
STRIPE_PUBLIC_KEY="",
STRIPE_SECRET_KEY="",
PAYMENTS_PLANS={},
DATABASES={
"default": {
"ENGINE": "django.db.backends.sqlite3",
"NAME": ":memory:",
}
},
SITE_ID=1,
ROOT_URLCONF="notification.urls",
SECRET_KEY="notasecret",
)

from django_nose import NoseTestSuiteRunner

test_runner = NoseTestSuiteRunner(verbosity=1)
failures = test_runner.run_tests(["notification"])
def runtests(*test_args):
if not settings.configured:
settings.configure(**DEFAULT_SETTINGS)

# Compatibility with Django 1.7's stricter initialization
if hasattr(django, "setup"):
django.setup()

if failures:
parent = os.path.dirname(os.path.abspath(__file__))
sys.path.insert(0, parent)

try:
from django.test.runner import DiscoverRunner
runner_class = DiscoverRunner
test_args = ["notification.tests"]
except ImportError:
from django.test.simple import DjangoTestSuiteRunner
runner_class = DjangoTestSuiteRunner
test_args = ["tests"]

failures = runner_class(
verbosity=1, interactive=True, failfast=False).run_tests(test_args)
sys.exit(failures)


if __name__ == "__main__":
runtests(*sys.argv[1:])
20 changes: 4 additions & 16 deletions tox.ini
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
[tox]
envlist = py27-django14,py27-django15,py27-django16,py33-django16
envlist = py27-django14,py27-django15,py27-django16

[testenv]
downloadcache = {toxworkdir}/cache/
Expand All @@ -10,29 +10,17 @@ deps =
[testenv:py27-django14]
basepython = python2.7
deps =
Django==1.4.8
Django==1.4.13
{[testenv]deps}

[testenv:py27-django15]
basepython = python2.7
deps =
Django==1.5.4
Django==1.5.8
{[testenv]deps}

[testenv:py27-django16]
basepython = python2.7
deps =
https://www.djangoproject.com/download/1.6b4/tarball/
{[testenv]deps}

[testenv:py33-django15]
basepython = python3.3
deps =
Django==1.5.4
{[testenv]deps}

[testenv:py33-django16]
basepython = python3.3
deps =
https://www.djangoproject.com/download/1.6b4/tarball/
Django==1.6.5
{[testenv]deps}

0 comments on commit 6782099

Please # to comment.