incorporeal-cms/tox.ini

85 lines
1.7 KiB
INI
Raw Normal View History

2020-06-16 22:59:23 -05:00
# tox (https://tox.readthedocs.io/) is a tool for running tests
# in multiple virtualenvs. This configuration file will run the
# test suite on all supported python versions. To use it, "pip install tox"
# and then run "tox" from this directory.
[tox]
envlist = py37,security,lint
2020-06-16 22:59:23 -05:00
[testenv]
# build a wheel and test it
wheel = true
wheel_build_env = build
# whitelist commands we need
whitelist_externals = ln
[testenv:build]
# require setuptools when building
deps = setuptools
[testenv:py37]
# run pytest and coverage
2020-06-16 22:59:23 -05:00
deps =
pytest
pytest-cov
2020-06-16 22:59:23 -05:00
commands =
pytest --cov={envsitepackagesdir}/incorporealcms/ \
--cov-report=term-missing --cov-branch --cov-fail-under=90
2020-06-16 22:59:23 -05:00
ln -sf {distdir} dist
[testenv:security]
# run security checks
#
# again it seems the most valuable here to run against the packaged code
deps =
bandit
commands =
bandit {envsitepackagesdir}/incorporealcms/ -r
[testenv:lint]
# run style checks
skip_install = true
deps =
flake8
flake8-blind-except
flake8-builtins
flake8-docstrings
flake8-executable
2020-06-19 20:23:23 -05:00
flake8-isort
flake8-logging-format
commands =
flake8
2020-06-19 20:23:23 -05:00
- flake8 --disable-noqa --select=E,W,F,C,D,A,G,B,I
[coverage:paths]
source =
./
.tox/**/site-packages/
[coverage:run]
branch = True
omit =
**/_version.py
2020-06-16 22:59:23 -05:00
[flake8]
max-line-length = 120
exclude =
.tox/
versioneer.py
_version.py
instance/
max-complexity = 10
2020-06-16 22:59:23 -05:00
2020-06-19 20:23:23 -05:00
[isort]
line_length = 120
# only way I could figure out how to make tests/conftest.py happy and have pytest separate from incorporealcms
# and if I let them be combined in tox runs, flake8-isort in vim would complain :(
forced_separate = incorporealcms
2020-06-16 22:59:23 -05:00
[pytest]
python_files =
*_tests.py
tests.py
test_*.py