with one click
api-testing
API testing patterns for FastAPI endpoints using pytest and httpx
Install with Codex or Claude Copy this prompt, paste it into Codex, Claude, or another assistant, and let it review the skill page and install it for you.
Menu
API testing patterns for FastAPI endpoints using pytest and httpx
Install with Codex or Claude Copy this prompt, paste it into Codex, Claude, or another assistant, and let it review the skill page and install it for you.
Based on SOC occupation classification
Debug frontend vanilla JS issues - console errors, rendering bugs, SPA navigation, WebSocket
Automates the process of setting up the first admin user or adding new admins via the bootstrap endpoint. Includes a Python script for easy execution.
Push to remote and wait for CI to pass. If CI fails, read logs, fix bugs, and re-push. Repeat until green.
Use when building or debugging LangGraph multi-agent systems - eval-first execution, task decomposition, model routing by complexity, and cost discipline
Use when AI agent modifies API routes or backend logic - catch systematic blind spots where the same model writes and reviews code
Use when making or recording significant architectural decisions - capture context, alternatives, and rationale as structured ADRs
| name | api-testing |
| description | API testing patterns for FastAPI endpoints using pytest and httpx |
httpx.AsyncClient with app from api.maintests/conftest.py (TEST_MODE=true, mock DB)--no-cov flag: .venv\Scripts\python.exe -m pytest --no-cov# All API tests
.venv\Scripts\python.exe -m pytest tests/ --no-cov -v
# Single test file
.venv\Scripts\python.exe -m pytest tests/test_premium_upgrade.py --no-cov -v
# Single test
.venv\Scripts\python.exe -m pytest tests/test_rate_limiting.py::test_login_rate_limit --no-cov -v
# By marker
.venv\Scripts\python.exe -m pytest -m unit --no-cov
import pytest
from httpx import AsyncClient
@pytest.mark.asyncio
async def test_endpoint_name():
async with AsyncClient(app=app, base_url="http://test") as client:
response = await client.post(
"/api/endpoint",
json={"key": "value"},
headers={"Authorization": "Bearer test_token"}
)
assert response.status_code == 200
data = response.json()
assert data["success"] is True
{"X-Test-User-ID": "123"}get_current_user dependency# SlowAPI stores limits in limiter._route_limits dict
key = "module.path" # e.g., "api.routers.user.login"
limits = app.state.limiter._route_limits.get(key)
assert limits is not None
pytest.mark.unit for no-DB testspytest.mark.integration for real DB teststests/test_agent_scenarios.py (pre-existing, broken)--cov flag (breaks SlowAPI inspect.signature)tests/ files together (hangs on external service tests)