feat: Projektgerüst, Datenmodell und initiale Migration
Schritt 1: src-Layout mit FastAPI-Stack, SQLAlchemy-2.x-Modell inkl. Buchführung für Kopiermodus und Quarantäne, Alembic-Migration 0001, strukturierte Logs, CLI (migrate/version), Changelog und Devlog. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This commit is contained in:
@@ -0,0 +1,25 @@
|
||||
from __future__ import annotations
|
||||
|
||||
from collections.abc import Iterator
|
||||
from pathlib import Path
|
||||
|
||||
import pytest
|
||||
from sqlalchemy.orm import Session
|
||||
|
||||
from netmover.db import make_engine, make_session_factory, upgrade
|
||||
|
||||
|
||||
@pytest.fixture
|
||||
def db_url(tmp_path: Path) -> str:
|
||||
url = f"sqlite:///{tmp_path / 'test.db'}"
|
||||
upgrade(url)
|
||||
return url
|
||||
|
||||
|
||||
@pytest.fixture
|
||||
def session(db_url: str) -> Iterator[Session]:
|
||||
engine = make_engine(db_url)
|
||||
factory = make_session_factory(engine)
|
||||
with factory() as s:
|
||||
yield s
|
||||
engine.dispose()
|
||||
Reference in New Issue
Block a user