# Alicia — Lokale Test-Umgebung einrichten > **Einmalig ausführen.** Danach nur noch `pytest -v` vor jedem Commit. ## Installation ```bash cd /tmp/BSN-Livesystem # 1. Virtuelle Umgebung anlegen python3 -m venv .venv source .venv/bin/activate # 2. Projekt + Dev-Dependencies installieren pip install flask pydantic redis structlog pytest pytest-cov mypy fakeredis # 3. Ruff installieren (via pip) pip install ruff # 4. Testen ob alles geht ruff check . ruff format --check . mypy --config-file pyproject.toml . pytest -v ``` ## Täglicher Workflow ```bash cd /tmp/BSN-Livesystem source .venv/bin/activate # venv aktivieren (einmal pro Session) git pull origin main # aktuellen Stand holen # ... Dateien erstellen/bearbeiten ... # VOR jedem Commit: ruff check . ruff format . mypy --config-file pyproject.toml . pytest -v # Wenn ALLE 4 Checks grün: git add -A git commit -m "feat: ..." git push origin main ``` ## Was ist was | Befehl | Prüft | |---|---| | `ruff check .` | Code-Stil, Sicherheit, Magic-Values | | `ruff format .` | Formatierung (macht auto-fix) | | `mypy --config-file pyproject.toml .` | Statische Typ-Prüfung | | `pytest -v` | Alle Tests ausführen |