tests: use pytest instead of unittest

pytest provides session scoped fixtures, making it much easier
to reuse resources across tests.
This commit is contained in:
Lucian Petrut
2026-09-07 11:52:46 +00:00
parent 4ddf0c015d
commit 1e9c2816ef
15 changed files with 403 additions and 454 deletions
+3 -7
View File
@@ -33,8 +33,7 @@ setenv =
LD_LIBRARY_PATH={[vars]vddk_path}
LD_PRELOAD=
commands =
stestr run --slowest --concurrency 1 \
--test-path tests/integration/ {posargs}
python -m pytest -v tests/integration/ {posargs}
[testenv:integration-coverage]
description = Integration tests with coverage report.
@@ -44,11 +43,10 @@ setenv =
{[testenv:integration]setenv}
deps =
{[testenv]deps}
pytest
pytest-cov
pycobertura
commands =
pytest --cov=openvixdisklib --cov-report=term-missing \
python -m pytest --cov=openvixdisklib --cov-report=term-missing \
--cov-report=xml -p no:cacheprovider tests/integration/ {posargs}
pycobertura show --format html --source openvixdisklib \
coverage.xml -o coverage.html
@@ -73,6 +71,7 @@ commands =
description = Type checks (mypy).
deps =
mypy
pytest
commands =
mypy {[vars]all_path}
@@ -89,6 +88,3 @@ ignore = E125,E251,W503,W504,E305,E731,E117,W605,F632
exclude = .venv,.git,.tox,dist,build,*.egg
# Same length as ruff.
max-line-length = 88
[stestr]
test_path = ./tests