Test¶
Every code commit triggers a travis-ci build. checkout current build status at https://travis-ci.org/django-cas-ng/django-cas-ng
Testing is managed by pytest
and tox
.
Before run install, you need install required packages for testing:
$ pip install -r requirements-dev.txt
Run Test¶
To run testing on locally:
$ py.test
To run testing on locally with code coverage:
$ py.test --cov-report=html --cov=django_cas_ng
...
...
Coverage HTML written to dir htmlcov
To run all testing on all environments locally:
$ tox
tox.ini - tox Configuration Reference¶
[tox]
envlist=
py{35,36,37}-django20
py{35,36,37}-django21
py{35,36,37,38}-django22
py{36,37,38}-django30
py{36,37,38}-djangomaster
flake8
[flake8]
# E402 module level import not at top of file
# E501 line too long
ignore = E501
[testenv]
deps =
django20: Django>=2.0,<2.1
django21: Django>=2.1,<2.2
django22: Django>=2.2,<3.0
django30: Django>=3.0b1
djangomaster: https://github.com/django/django/archive/master.tar.gz
pytest
pytest-cov
pytest-django
pytest-pythonpath
commands=py.test --cov-report term-missing --cov django_cas_ng --tb native {posargs:tests}
[testenv:flake8]
deps=flake8
commands=flake8
skip_install = true
[testenv:isort]
deps = isort
commands = isort --check-only --diff
skip_install = true
.travis.yml - travis-ci Configuration Reference¶
language: python
cache: pip
matrix:
fast_finish: true
include:
- python: 3.5
env: TOXENV=py35-django20
- python: 3.6
env: TOXENV=py36-django20
- python: 3.7
env: TOXENV=py37-django20
- python: 3.5
env: TOXENV=py35-django21
- python: 3.6
env: TOXENV=py36-django21
- python: 3.7
env: TOXENV=py37-django21
- python: 3.5
env: TOXENV=py35-django22
- python: 3.6
env: TOXENV=py36-django22
- python: 3.7
env: TOXENV=py37-django22
- python: 3.8
env: TOXENV=py38-django22
- python: 3.6
env: TOXENV=py36-django30
- python: 3.7
env: TOXENV=py37-django30
- python: 3.8
env: TOXENV=py38-django30
- python: 3.6
env: TOXENV=py36-djangomaster
- python: 3.7
env: TOXENV=py37-djangomaster
- python: 3.8
env: TOXENV=py38-djangomaster
- env: TOXENV=flake8
- env: TOXENV=isort
allow_failures:
- env: TOXENV=py36-djangomaster
- env: TOXENV=py37-djangomaster
- env: TOXENV=py38-djangomaster
install:
- pip install tox
- pip install codecov
script:
- tox
# Push the results back to codecov
after_success:
- codecov