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:
@@ -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
|
||||
|
||||
Reference in New Issue
Block a user