원클릭으로
testing-standards
Apply project testing standards for app/tests layout, naming, dependency overrides, and route/service coverage.
Codex 또는 Claude로 설치 이 Prompt를 복사해 Codex, Claude 또는 다른 어시스턴트에 붙여 넣으면 Skill 페이지를 검토하고 설치를 진행할 수 있습니다.
메뉴
Apply project testing standards for app/tests layout, naming, dependency overrides, and route/service coverage.
Codex 또는 Claude로 설치 이 Prompt를 복사해 Codex, Claude 또는 다른 어시스턴트에 붙여 넣으면 Skill 페이지를 검토하고 설치를 진행할 수 있습니다.
SOC 직업 분류 기준
Run and triage Python quality gates with minimal, root-cause fixes; use when validating feature work before completion.
Apply typed FastAPI route patterns with clean dependency boundaries, stable error mapping, and test coverage for success/failure paths.
Author review-ready implementation plans grounded in real code, with a hard single-PR size gate and decomposition into safe incremental tasks when exceeded.
Apply partitioned settings and singleton provider patterns; use when adding or refactoring settings and provider wiring.
Operate Backlog.md tasks through the backlog CLI only; use when reading, planning, executing, or finalizing any task under backlog/tasks.
Apply pluggy registration and lifespan startup patterns for package discovery, initialization ordering, and testable startup behavior.
| name | testing-standards |
| description | Apply project testing standards for app/tests layout, naming, dependency overrides, and route/service coverage. |
Mirror app/ under app/tests/:
app/tests/unit/ — isolated units with Protocol fakes. Cost <50ms.app/tests/integration/ — feature + infrastructure with external deps stubbed. Cost <500ms.app/tests/smoke/ — live systems. On-demand only.Names: test_<domain>_<entity>_<action>.py. No generic names.
Test one function/class in isolation.
async def test_item_service_fetch_success(mocker):
fake_adapter = mocker.Mock(spec=ItemAdapter)
fake_adapter.get_item.return_value = OperationResult(SUCCESS, payload=Item(...))
service = ItemService(adapter=fake_adapter)
result = await service.fetch("id1")
assert result.status == SUCCESS
assert result.payload.name == "expected"
Use Protocol-conformant fakes. Assert on OperationResult status, not provider details.
Test feature service + infrastructure with external deps stubbed.
async def test_item_route_success(app, monkeypatch):
fake_adapter = FakeItemAdapter()
app.dependency_overrides[get_item_service] = lambda: ItemService(fake_adapter)
client = TestClient(app)
response = client.get("/items/id1")
assert response.status_code == 200
assert response.json()["name"] == "expected"
app.dependency_overrides.clear()
Clear dependency_overrides in finally or use fixture autouse.
Narrow-slice settings only. Clear @lru_cache between tests:
@pytest.fixture(autouse=True)
def _clear_caches():
yield
from app.packages.myfeature import providers
providers.get_service.cache_clear()
app/tests/.dependency_overrides cleanup.