Milestone 288 — pattern library + forge integration #111

Merged
bvandeusen merged 10 commits from dev into main 2026-08-16 16:37:12 -04:00
Showing only changes of commit 7d26a3fc6a - Show all commits
+11
View File
@@ -88,10 +88,21 @@ async def _dispose_engine():
@pytest_asyncio.fixture
async def user_id(_dispose_engine):
# Get-or-create: the lane's database persists across tests, so a second
# test re-creating the same username dies on the unique constraint.
from sqlalchemy import select
from scribe.models import async_session
from scribe.models.user import User
async with async_session() as s:
existing = (
await s.execute(
select(User).where(User.username == "snippet_prov_itest")
)
).scalar_one_or_none()
if existing is not None:
return existing.id
user = User(username="snippet_prov_itest")
s.add(user)
await s.flush()