feat(infra): каркас проекта — uv, ruff, mypy, pytest, Docker Compose
- pyproject: Python 3.12, зависимости ADR-009, ruff/mypy strict/pytest/coverage - app/: точка входа-заглушка с graceful shutdown по SIGTERM - Dockerfile: multi-stage, uv, non-root (uid 10001), git+ssh для коммитов (#9); apt по HTTPS — в некоторых сетях обычный HTTP к deb.debian.org заблокирован - docker-compose: bot + postgres 16, healthcheck, лимиты памяти, ротация логов - Makefile: install/lint/fmt/test/cov/up/down/logs/ps; .env.example Refs #3 Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This commit is contained in:
@@ -0,0 +1,13 @@
|
||||
import asyncio
|
||||
|
||||
from app.main import run
|
||||
|
||||
|
||||
async def test_run_returns_when_stop_is_set() -> None:
|
||||
stop = asyncio.Event()
|
||||
task = asyncio.create_task(run(stop))
|
||||
await asyncio.sleep(0)
|
||||
assert not task.done()
|
||||
|
||||
stop.set()
|
||||
await asyncio.wait_for(task, timeout=1)
|
||||
Reference in New Issue
Block a user