Skip to content

Commit 9d3e6dc

Browse files
committed
chore: улучшить тестовые команды и маркеры pytest
- Добавлена отдельная команда для integration тестов - Добавлена команда очистки артефактов покрытия - Добавлен pytest marker integration
1 parent a32fc24 commit 9d3e6dc

2 files changed

Lines changed: 12 additions & 0 deletions

File tree

Justfile

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -85,6 +85,10 @@ test:
8585
test-unit:
8686
uv run pytest tests/unit -q
8787

88+
# Запустить интеграционные тесты (требуется доступная PostgreSQL БД).
89+
test-integration:
90+
uv run pytest tests/integration -q -m integration
91+
8892
# Запустить тесты с покрытием в консоли.
8993
test-cov:
9094
uv run pytest --cov=app --cov-report=term-missing
@@ -93,6 +97,11 @@ test-cov:
9397
test-cov-html:
9498
uv run pytest --cov=app --cov-report=html
9599

100+
# Очистить артефакты тестов и покрытия.
101+
test-clear:
102+
rm -rf htmlcov .pytest_cache
103+
rm -f .coverage coverage.xml
104+
96105
# Проверить код линтером Ruff (без автоисправлений).
97106
lint:
98107
uv run ruff check .

pyproject.toml

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -42,3 +42,6 @@ testpaths = ["tests"]
4242
python_files = ["test_*.py"]
4343
asyncio_mode = "auto"
4444
addopts = "-ra"
45+
markers = [
46+
"integration: интеграционные тесты с реальной базой данных",
47+
]

0 commit comments

Comments
 (0)