use tox to run tests (#39560)

This commit is contained in:
Emmanuel Cazenave 2020-02-05 14:48:36 +01:00
parent 10284247ec
commit 6b0fcffee6
2 changed files with 29 additions and 0 deletions

8
tests/settings.py Normal file
View File

@ -0,0 +1,8 @@
LANGUAGE_CODE = 'en-us'
TIME_ZONE = 'UTC'
INSTALLED_APPS += (
'passerelle_montpellier_encombrants',
)

21
tox.ini Normal file
View File

@ -0,0 +1,21 @@
[tox]
envlist = py2-junit, py3-junit-coverage
toxworkdir = {env:TMPDIR:/tmp}/tox-{env:USER}/passerelle-montpellier-encombrants/{env:BRANCH_NAME:}
[testenv]
usedevelop =
coverage: True
nocoverage: False
setenv =
DJANGO_SETTINGS_MODULE=passerelle.settings
PASSERELLE_SETTINGS_FILE=tests/settings.py
coverage: COVERAGE=--cov-report xml --cov-report html --cov=passerelle_montpellier_encombrants/
junit: JUNIT=--junitxml=junit-{envname}.xml
deps =
http://git.entrouvert.org/passerelle.git/snapshot/passerelle-master.tar.gz
xmlschema<1.1
pytest
pytest-cov
pytest-django
commands =
py.test {posargs: {env:JUNIT:} {env:COVERAGE:} tests/}