Tox. Runtests. Travis. Yay.

This commit is contained in:
Martin Mahner 2013-11-25 22:44:36 +01:00
parent c4dbc7f812
commit 8b209acfb4
4 changed files with 63 additions and 4 deletions

View file

@ -1,6 +1,6 @@
[run] [run]
source = parallel = True
dpaste source = dpaste
branch = True branch = True
omit = omit =
dpaste/migrations/* dpaste/migrations/*
@ -10,3 +10,6 @@ omit =
exclude_lines = exclude_lines =
pragma: no cover pragma: no cover
def __repr__ def __repr__
[html]
directory = /tmp/coverage_html_report

View file

@ -3,9 +3,9 @@ python:
- "2.7" - "2.7"
- "3.3" - "3.3"
install: install:
- "pip install Django==1.6
- "pip install -e ." - "pip install -e ."
- "pip install -r requirements.txt"
script: script:
coverage run --rcfile=.coverage.rc manage.py test coverage run --rcfile=.coverage.rc runtests.py
after_success: after_success:
coveralls --config_file=.coverage.rc --coveralls_yaml=.coveralls.yml coveralls --config_file=.coverage.rc --coveralls_yaml=.coveralls.yml

33
runtests.py Normal file
View file

@ -0,0 +1,33 @@
#!/usr/bin/env python
import sys
from django.conf import settings
if not settings.configured:
settings.configure(
DATABASES = {
'default': {
'ENGINE': 'django.db.backends.sqlite3',
'NAME': 'dev.db',
}
},
INSTALLED_APPS=[
'django.contrib.sessions',
'django.contrib.staticfiles',
'mptt',
'dpaste',
],
STATIC_ROOT='/tmp/dpaste_test_static/',
STATIC_URL='/static/',
ROOT_URLCONF='dpaste.urls',
)
def runtests(*test_args):
from django.test.simple import DjangoTestSuiteRunner
test_runner = DjangoTestSuiteRunner(verbosity=1)
failures = test_runner.run_tests(['dpaste', ])
if failures:
sys.exit(failures)
if __name__ == '__main__':
runtests(*sys.argv[1:])

23
tox.ini Normal file
View file

@ -0,0 +1,23 @@
[tox]
toxworkdir={toxinidir}/.tox
envlist=
py27-django-1.4,
py27-django-1.5,
py27-django-1.6,
py33-django-1.6,
[testenv]
commands=
python runtests.py
[testenv:py27-django-1.4]
deps=django==1.4
[testenv:py27-django-1.5]
deps=django==1.5
[testenv:py27-django-1.6]
deps=django==1.6
[testenv:py33-django-1.6]
deps=django==1.6