33 lines
1 KiB
INI
33 lines
1 KiB
INI
[tox]
|
|
minversion = 3.5
|
|
# relies on the correct version of Python installed
|
|
envlist = tests,mypy
|
|
# https://github.com/tox-dev/tox/issues/20#issuecomment-247788333
|
|
# hack to prevent .tox from crapping to the project directory
|
|
toxworkdir={env:TOXWORKDIR_BASE:}{toxinidir}/.tox
|
|
|
|
[testenv]
|
|
passenv =
|
|
# useful for tests to know they are running under ci
|
|
CI
|
|
CI_*
|
|
# respect user's cache dirs to prevent tox from crapping into project dir
|
|
MYPY_CACHE_DIR
|
|
PYTHONPYCACHEPREFIX
|
|
|
|
[testenv:tests]
|
|
commands =
|
|
pip install -e .[testing]
|
|
# posargs allow test filtering, e.g. tox ... -- -k test_name
|
|
python -m pytest server --ignore server/test_with_browser.py {posargs}
|
|
|
|
[testenv:mypy]
|
|
commands =
|
|
pip install -e .[linting]
|
|
python -m mypy --install-types --non-interactive \
|
|
server \
|
|
# txt report is a bit more convenient to view on CI
|
|
--txt-report .coverage.mypy \
|
|
--html-report .coverage.mypy \
|
|
{posargs}
|