-
Notifications
You must be signed in to change notification settings - Fork 7
/
tox.ini
70 lines (64 loc) · 1.44 KB
/
tox.ini
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
# Copyright 2024 Canonical
# See LICENSE file for licensing details.
[tox]
skipsdist = True
skip_missing_interpreters = True
env_list = lint, unit
[testenv]
setenv =
PYTHONPATH = {toxinidir}:{toxinidir}/src/:{toxinidir}/lib/
passenv =
OS_*
HOME
PYTHONPATH
MODEL_SETTINGS
CHARM_*
TEST_*
[testenv:format]
description = Apply coding style standards to code
deps =
ruff
codespell
tomli
commands =
codespell -w .
ruff format .
ruff check --fix --exit-zero --silent . # we only want --fix feature here
[testenv:lint]
description = Run static analysis
deps =
ruff
codespell
isort
colorama
tomli
mypy
commands =
codespell .
ruff format --diff .
ruff check --no-fix .
mypy --install-types --non-interactive .
[testenv:unit]
description = Run unit tests
deps =
pytest
coverage[toml]
-r {toxinidir}/requirements.txt
-r {toxinidir}/tests/unit/requirements.txt
commands =
coverage run --source={toxinidir}/src \
-m pytest \
--tb native \
-v \
-s \
{posargs} \
{toxinidir}/tests/unit
coverage report
[testenv:func]
description = Run functional / integration tests
changedir = {toxinidir}/tests/integration
deps =
-r {toxinidir}/requirements.txt
-r {toxinidir}/tests/integration/requirements.txt
commands =
functest-run-suite {posargs:--keep-faulty-model}