원클릭으로
buscamedicos-testing
Testing patterns for BuscaMedicos. Pytest with async support, fixtures, and project-specific test conventions.
Codex 또는 Claude로 설치 이 Prompt를 복사해 Codex, Claude 또는 다른 어시스턴트에 붙여 넣으면 Skill 페이지를 검토하고 설치를 진행할 수 있습니다.
메뉴
Testing patterns for BuscaMedicos. Pytest with async support, fixtures, and project-specific test conventions.
Codex 또는 Claude로 설치 이 Prompt를 복사해 Codex, Claude 또는 다른 어시스턴트에 붙여 넣으면 Skill 페이지를 검토하고 설치를 진행할 수 있습니다.
SOC 직업 분류 기준
| name | buscamedicos-testing |
| description | Testing patterns for BuscaMedicos. Pytest with async support, fixtures, and project-specific test conventions. |
| license | MIT |
Pytest-based testing for the BuscaMedicos backend. Uses pytest-asyncio for async tests and httpx for async HTTP clients.
Use this skill when:
# Run all tests
cd backend_api && pytest tests/ -v
# Run specific test file
cd backend_api && pytest tests/test_step2.py -v
# Run with coverage
cd backend_api && pytest tests/ -v --cov=app
# Run only failed
cd backend_api && pytest tests/ --lf
import pytest
from httpx import AsyncClient
from app.main import app
@pytest.fixture
async def client():
async with AsyncClient(app=app, base_url="http://test") as ac:
yield ac
@pytest.mark.asyncio
async def test_endpoint(client: AsyncClient):
response = await client.get("/health/live")
assert response.status_code == 200
assert response.json()["status"] == "ok"
Place fixtures in backend_api/tests/conftest.py or inline in test files.
# Always use @pytest.mark.asyncio for async tests
@pytest.mark.asyncio
async def test_async_function(client: AsyncClient):
# ...
@pytest.fixture
async def db_session():
# Async database session for testing
async with async_session_maker() as session:
yield session
@pytest.fixture
async def authenticated_client(client: AsyncClient, test_user):
# Client with auth header set
client.headers["Authorization"] = f"Bearer {test_user_token}"
return client
@pytest.mark.asyncio
async def test_protected_endpoint(client: AsyncClient, auth_token):
response = await client.get(
"/api/v1/admin/resource",
headers={"Authorization": f"Bearer {auth_token}"}
)
assert response.status_code == 200
from unittest.mock import patch
async def test_with_mock(client: AsyncClient):
with patch("app.services.SomeService.method") as mock:
mock.return_value = expected_value
response = await client.get("/endpoint")
assert response.json()["data"] == expected_value
backend_api/tests/
├── conftest.py # Shared fixtures
├── test_step2.py # Step2 model tests
├── test_step3.py # Payment tests
├── test_step6.py # Moderation tests
├── test_step7.py # Privacy tests
└── test_api.py # API endpoint tests
pytest.ini exists - defaults applyasync_session_makerAuthentication patterns for BuscaMedicos web frontend. JWT handling, login, register, session persistence, and role-based redirection.
Nuxt 4 + Vue 3 + Vuetify frontend for BuscaMedicos. Pages, layouts, components, composables, and stores patterns.
Git add, commit and push workflow for BuscaMedicos. Streamlined commands with CI env vars for non-interactive Git operations.
Alembic migration workflow for BuscaMedicos. Create, autogenerate, and run migrations following the step2-step8 architecture.
Docker Compose development workflow for BuscaMedicos. Start/stop/verify containers, check logs, rebuild with --build flag.
Error handling patterns for BuscaMedicos FastAPI. HTTPException, custom exceptions, and consistent error response format.