From fastapi-vue
Creates and runs pytest tests for FastAPI features with AC traceability markers. Uses real async DB session — never mocks the database layer. Invoked by core:test and core:sprint. Use when the user says "test fastapi", "write pytest tests", or "run backend tests".
How this skill is triggered — by the user, by Claude, or both
Slash command
/fastapi-vue:test-fastapi-vue FEAT-001FEAT-001The summary Claude sees in its skill listing — used to decide when to auto-load this skill
Create pytest tests for the feature in `$ARGUMENTS`. One test function per AC.
Create pytest tests for the feature in $ARGUMENTS. One test function per AC.
Tests run against a real async database (Alembic creates the test schema).
Use @pytest.mark.feature and @pytest.mark.ac for traceability.
Tests live in backend/tests/ matching the feature structure:
backend/
└── tests/
├── conftest.py # async DB session + httpx AsyncClient fixtures
└── test_FEAT_NAME.py # one file per feature
import pytest
from httpx import AsyncClient, ASGITransport
from sqlalchemy.ext.asyncio import AsyncSession, create_async_engine, async_sessionmaker
from app.main import app
from app.database import Base, get_session
import os
TEST_DB_URL = os.getenv("TEST_DATABASE_URL", "postgresql+asyncpg://appuser:apppassword@localhost:5432/testdb")
@pytest.fixture(scope="session")
def anyio_backend():
return "asyncio"
@pytest.fixture(scope="session")
async def engine():
engine = create_async_engine(TEST_DB_URL)
async with engine.begin() as conn:
await conn.run_sync(Base.metadata.create_all)
yield engine
async with engine.begin() as conn:
await conn.run_sync(Base.metadata.drop_all)
await engine.dispose()
@pytest.fixture
async def session(engine):
async_session = async_sessionmaker(engine, expire_on_commit=False)
async with async_session() as s:
yield s
@pytest.fixture
async def client(session):
app.dependency_overrides[get_session] = lambda: session
async with AsyncClient(transport=ASGITransport(app=app), base_url="http://test") as c:
yield c
app.dependency_overrides.clear()
docs/features/FEAT-XXX-*.md for the feature spec and ACsbackend/tests/conftest.py — create if absent (use pattern above)backend/tests/test_FEAT_NAME.py with one test per ACcd backend && pytest tests/test_FEAT_NAME.py -vnpx claudepluginhub bfh-krg1/sdd-web-app --plugin fastapi-vueMines projects and conversations into a searchable memory palace. Activates on queries about MemPalace, memory palace, mining, searching, palace setup, wings, rooms, drawers, or recalling past work.
Guides Payload CMS config (payload.config.ts), collections, fields, hooks, access control, APIs. Debugs validation errors, security, relationships, queries, transactions, hook behavior.
Implements vector databases with Pinecone, Weaviate, Qdrant, Milvus, pgvector for semantic search, RAG, recommendations, and similarity systems. Optimizes embeddings, indexing, and hybrid search.