Charmed-Kubernetes/etcd/tox.ini

55 lines
1.5 KiB
INI

[flake8]
max-line-length = 120
[tox]
skipsdist = True
envlist = lint,unit
[testenv]
basepython = python3
setenv =
PYTHONPATH={toxinidir}:{toxinidir}/lib
[testenv:format]
deps =
black
commands =
black {toxinidir}/actions {toxinidir}/reactive {toxinidir}/lib {toxinidir}/tests/integration {toxinidir}/tests/unit
[testenv:unit]
deps =
pyyaml
pytest
pytest-mock
pytest-cov
charms.unit_test
commands =
pytest --cov-report term-missing \
--cov lib --cov-fail-under 33 \
--tb native -s {posargs} {toxinidir}/tests/unit
[testenv:integration]
deps =
pytest
pytest-operator
charms.unit_test
commands = pytest --tb native --show-capture=no --disable-pytest-warnings --log-cli-level=INFO -s {posargs} {toxinidir}/tests/integration
[testenv:lint]
deps =
black
flake8
envdir = {toxworkdir}/py3
commands =
flake8 {toxinidir}/reactive {toxinidir}/lib {toxinidir}/tests/integration {toxinidir}/tests/unit
black --check --diff {toxinidir}/actions {toxinidir}/reactive {toxinidir}/lib {toxinidir}/tests/integration {toxinidir}/tests/unit
[testenv:validate-wheelhouse]
deps =
# Temporarily pin setuptools to avoid the breaking change from 58 until
# all dependencies we use have a chance to update.
# See: https://setuptools.readthedocs.io/en/latest/history.html#v58-0-0
# and: https://github.com/pypa/setuptools/issues/2784#issuecomment-917663223
setuptools<58
allowlist_externals = {toxinidir}/tests/validate-wheelhouse.sh
commands = {toxinidir}/tests/validate-wheelhouse.sh