Add tox and run tests for python 2.7/3.5 and Django 1.6-1.8

This commit is contained in:
ekmartin 2015-11-07 03:54:56 +01:00
parent 57f21d71e2
commit 351a18ba07
4 changed files with 40 additions and 1 deletions

3
.gitignore vendored
View File

@ -2,5 +2,6 @@
dist/
docs/_build
__pycache__/
.tox/
*.swp
*.pyc

View File

@ -0,0 +1,7 @@
SECRET_KEY = 'cat'
DATABASES = {
'default': {
'ENGINE': 'django.db.backends.sqlite3',
}
}

15
runtests.py Normal file
View File

@ -0,0 +1,15 @@
#!/usr/bin/env python
import os
import sys
import django
from django.conf import settings
from django.test.utils import get_runner
if __name__ == "__main__":
os.environ['DJANGO_SETTINGS_MODULE'] = "channels.tests.settings"
django.setup()
TestRunner = get_runner(settings)
test_runner = TestRunner()
failures = test_runner.run_tests(["channels.tests"])
sys.exit(bool(failures))

16
tox.ini Normal file
View File

@ -0,0 +1,16 @@
[tox]
skipsdist = True
envlist =
{py27,py35}-django-{16,17,18}
[testenv]
setenv =
PYTHONPATH = {toxinidir}:{toxinidir}
deps =
six
redis==2.10.5
django-16: Django>=1.6,<1.7
django-17: Django>=1.7,<1.8
django-18: Django>=1.8,<1.9
commands =
python {toxinidir}/runtests.py