pungi/tox.ini
Lubomír Sedlář f82897187e Drop parameterized dependency
There were 4 files using this library. Since we already require pytest
to run the tests, we can migrate the tests to use
pytest.mark.parametrize to achieve the same thing with one less library
being pulled in.

However, the pytest approach is not compatible with tests based on
`unittest.TestCase`. The relevant tests are thus rewritten to be purely
pytest based.

Assisted-By: claude-sonnet-4-5@20250929
Fixes: https://pagure.io/pungi/issue/1884
Signed-off-by: Lubomír Sedlář <lsedlar@redhat.com>
2025-11-13 12:39:57 +01:00

56 lines
1.2 KiB
INI

[tox]
envlist = bandit, flake8, black, py3
[testenv:flake8]
deps =
flake8
allowlist_externals = sh
commands =
sh -c "flake8 pungi pungi_utils setup.py tests/*py"
[testenv:bandit]
basepython = python3
skip_install = true
deps = bandit
commands =
bandit -r -ll pungi pungi_utils
ignore_outcome = True
[testenv:black]
basepython = python3
allowlist_externals = sh
deps =
{[testenv:flake8]deps}
black
commands =
{[testenv:flake8]commands}
black --check --diff pungi pungi_utils setup.py tests --exclude tests/_composes
[testenv:py3]
sitepackages = true
deps =
-rrequirements.txt
-rtest-requirements.txt
allowlist_externals =
sh
commands =
sh -c 'find . -name "__pycache__" -exec rm -rf \{\} +'
pip install --force-reinstall pytest
pytest {posargs}
[flake8]
exclude = doc/*,*.pyc,*.py~,*.in,*.spec,*.sh,*.rst
filename = *.py
max-line-length = 88
# E402: module level import not at top of file
# H301: one import per line
# H306: imports not in alphabetical order
# E226: missing whitespace around arithmetic operator
# W503: line break occured before a binary operator
# E203: whitespace before ':'
ignore = E402,H301,H306,E226,W503,E203
[pytest]
python_classes = Test* *TestCase
addopts = --ignore=tests/_composes