debian-forge/tox.ini
Michael Vogt d504165c80 mounts: add mounts_module_fixture to allow testing mount modules
Similar to `stages` and `sources` we need some basic infrastructure
so that we can use a `mounts_module` fixture for the coming tests
to the mount modules.
2024-04-11 17:40:21 +02:00

76 lines
1.7 KiB
INI

[tox]
env_list =
py{36,37,38,39,310,311,312}
lint
type
labels =
test = py{36,37,38,39,310,311,312}
lint = ruff, autopep8, pylint
type = mypy,mypy-strict
[testenv]
description = "run osbuild unit tests"
deps =
pytest
pytest-xdist
jsonschema
mako
iniparse
pyyaml
toml
pykickstart
# required by pykickstart but not pulled in automatically :/
requests
setenv =
LINTABLES = osbuild/ assemblers/* devices/* inputs/*.* mounts/*.* mounts/test/*.py runners/* sources/*.* stages/*.* inputs/test/*.py stages/test/*.py sources/test/*.py test/ tools/
LINTABLES_EXCLUDES = "*.json,*.sh"
LINTABLES_EXCLUDES_RE = ".*\.json$,.*\.sh"
TYPEABLES = osbuild
TYPEABLES_STRICT = ./osbuild/main_cli.py ./osbuild/util/parsing.py ./osbuild/testutil/atomic.py
passenv =
TEST_CATEGORY
commands =
bash -c 'python -m pytest --pyargs --rootdir=. {env:TEST_CATEGORY} {env:TEST_WORKERS}'
allowlist_externals =
bash
[testenv:ruff]
deps =
ruff==0.3.0
commands =
bash -c 'python -m ruff check {env:LINTABLES}'
[testenv:autopep8]
deps =
autopep8==2.0.4
pycodestyle==2.11.0
commands =
bash -c 'python -m autopep8 --diff --max-line-length 120 -a -a -a -j0 -r --exclude {env:LINTABLES_EXCLUDES} --exit-code {env:LINTABLES}'
[testenv:pylint]
deps =
pylint==3.0.2
commands =
bash -c 'python -m pylint --ignore-patterns {env:LINTABLES_EXCLUDES_RE} {env:LINTABLES}'
[testenv:mypy]
deps =
mypy==1.2.0
commands =
bash -c 'python -m mypy {env:TYPEABLES}'
[testenv:mypy-strict]
deps =
mypy==1.2.0
commands =
bash -c 'python -m mypy --follow-imports=skip --disallow-untyped-calls --disallow-untyped-defs --disallow-incomplete-defs {env:TYPEABLES_STRICT}'