Skip to main content

Run Tests

Chat-in-Bio has a comprehensive test suite with 90%+ backend coverage.

Run all tests

uv run pytest tests/

Run with coverage

uv run pytest tests/ --cov=chatinbio --cov-report=term-missing

Run specific test groups

# Database models
uv run pytest tests/test_db/

# API endpoints
uv run pytest tests/test_api/

# A2UI components and builder
uv run pytest tests/test_a2ui/

# Agent and tools
uv run pytest tests/test_agent/

Test structure

tests/
├── conftest.py # Shared fixtures (settings, db_session)
├── test_app.py # App factory tests
├── test_settings.py # Configuration tests
├── test_turnstile.py # Turnstile verification tests
├── test_integrations.py # Integration stub tests
├── test_db/
│ ├── test_models.py # All DB model tests
│ └── test_base.py # Engine/session factory tests
├── test_api/
│ ├── conftest.py # create_test_app() helper
│ ├── test_admin.py # Admin CRUD endpoint tests
│ ├── test_bio.py # Public bio endpoint tests
│ ├── test_chat.py # Chat controller function tests
│ ├── test_health.py # Health check tests
│ └── test_webhooks.py # Webhook endpoint tests
├── test_a2ui/
│ ├── test_components.py # A2UI component constructors
│ ├── test_builder.py # A2UIBuilder fluent API
│ └── test_surface.py # SurfaceManager tests
└── test_agent/
├── test_factory.py # Agent creation tests
├── test_prompts.py # System prompt generation
└── test_tools.py # All 7 agent tools

Linting and type checking

uv run ruff check src/ tests/
uv run mypy src/