mirror of
https://github.com/DarrenOfficial/dpaste.git
synced 2024-11-23 11:56:36 +11:00
Tox. Runtests. Travis. Yay.
This commit is contained in:
parent
c4dbc7f812
commit
8b209acfb4
4 changed files with 63 additions and 4 deletions
|
@ -1,6 +1,6 @@
|
|||
[run]
|
||||
source =
|
||||
dpaste
|
||||
parallel = True
|
||||
source = dpaste
|
||||
branch = True
|
||||
omit =
|
||||
dpaste/migrations/*
|
||||
|
@ -10,3 +10,6 @@ omit =
|
|||
exclude_lines =
|
||||
pragma: no cover
|
||||
def __repr__
|
||||
|
||||
[html]
|
||||
directory = /tmp/coverage_html_report
|
||||
|
|
|
@ -3,9 +3,9 @@ python:
|
|||
- "2.7"
|
||||
- "3.3"
|
||||
install:
|
||||
- "pip install Django==1.6
|
||||
- "pip install -e ."
|
||||
- "pip install -r requirements.txt"
|
||||
script:
|
||||
coverage run --rcfile=.coverage.rc manage.py test
|
||||
coverage run --rcfile=.coverage.rc runtests.py
|
||||
after_success:
|
||||
coveralls --config_file=.coverage.rc --coveralls_yaml=.coveralls.yml
|
||||
|
|
33
runtests.py
Normal file
33
runtests.py
Normal 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
23
tox.ini
Normal 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
|
Loading…
Reference in a new issue