Commit c7739c63 authored by Johan Bloemberg's avatar Johan Bloemberg

Streamline tox a little.

parent f895bf25
......@@ -14,7 +14,7 @@ test: &test_template
- ~/.cache/pip/
script:
- tox -e py34
- tox -e test
retry: 1
......
......@@ -235,13 +235,12 @@ To run only a specific test use:
tox -- -k test_name
To only run a specific test suite user for example:
To only run a specific test suite use for example:
.tox/py34/bin/failmap-admin test tests/test_smarturl.py
.tox/default/bin/failmap-admin test tests/test_smarturl.py
To generate coverage report after tests in HTML run:
A coverage report is generated after running tests, on OSX it can be viewed using:
coverage html
open htmlcov/index.html
Pytest allows to drop into Python debugger when a tests fails. To enable run:
......
......@@ -4,7 +4,7 @@
# install isort, experience it might have things different in tox :+
# pkg_resources.DistributionNotFound? -> tox -r (rebuild)
# running this test? env DJANGO_SETTINGS_MODULE=failmap_admin.settings
# .tox/py34/bin/pytest tests -k test_tls_scan_qualys
# .tox/default/bin/pytest tests -k test_tls_scan_qualys
#
# todo: create rate_limit mock
......
[tox]
envlist = check,py36,datasets
# list of test environment to run when none is explicitly specified by the '-e' argument.
envlist = check,test,datasets
# default test set runs test suite and fixture integrity checks
# default configuration for all tox test environments
[testenv]
# make all other testenvs use the same virtualenv directory as there is no difference in dependencies
# and this reduces time required to build the same environment for every command
envdir = {toxworkdir}/py36
envdir = {toxworkdir}/default
basepython = python3.6
usedevelop = True
extras =
development
# allow extras (eg: deploy requirements) to be enabled in CI
# allow setuptools extras (eg: deploy requirements) to be enabled in CI
{env:TOX_EXTRAS:}
setenv =
DJANGO_SETTINGS_MODULE = failmap_admin.settings
; # set database or fallback on sqlite memory database
; DJANGO_DATABASE = {env:DJANGO_DATABASE:test}
; passenv =
; DB_HOST
; DB_ENGINE
# test set runs test suite and fixture integrity checks
[testenv:test]
commands =
# run testsuite
coverage run --include 'failmap_admin/*' -m pytest {posargs}
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment