use tox to run tests (#39569)

This commit is contained in:
Emmanuel Cazenave 2020-02-05 15:49:53 +01:00
parent 48fcc18e68
commit 5b4fa9a321
2 changed files with 30 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_sig',
)

22
tox.ini Normal file
View File

@ -0,0 +1,22 @@
[tox]
envlist = py2-junit, py3-junit-coverage
toxworkdir = {env:TMPDIR:/tmp}/tox-{env:USER}/passerelle-montpellier-sig/{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_sig/
junit: JUNIT=--junitxml=junit-{envname}.xml
deps =
http://git.entrouvert.org/passerelle.git/snapshot/passerelle-master.tar.gz
httmock
pytest
pytest-cov
pytest-django
xmlschema<1.1
commands =
py.test {posargs: {env:JUNIT:} {env:COVERAGE:} tests/}