Testing
Test suite guide — 1,234 tests across the engine, clients, API, crypto tools, memory, lookouts, and more
Running Tests
# Install dev dependencies
pip install -e ".[dev]"
# Run all tests
pytest
# Run with verbose output
pytest -v
# Run a specific test file
pytest tests/test_api.py
# Run tests matching a pattern
pytest -k "test_research"Test Files
| File | Coverage |
|---|---|
test_api.py | API endpoint tests (health, research, search, results, export) |
test_api_new.py | Additional API tests (templates, steering, sessions, compare) |
test_charts.py | Data visualization extraction and rendering |
test_config.py | Settings and environment variable loading |
test_conflict_detection.py | Conflict detection between sources |
test_crypto_research.py | Crypto research tools and modes |
test_db.py | Database operations (results, sessions, lookouts, memory) |
test_export.py | PDF, HTML, and Markdown export |
test_lookouts.py | Scheduled research and change detection |
test_memory.py | Knowledge base — memorize, recall, compare |
test_models.py | Pydantic model validation |
test_prompts.py | Prompt template generation |
test_research_engine.py | Research engine — planning, agent loop, recursive search, synthesis |
test_scheduler.py | Lookout scheduler lifecycle |
test_structured_output.py | JSON Schema structured output extraction |
test_visualization.py | Chart data extraction and spec generation |
Client Tests
tests/test_clients/
├── test_browse.py # URL content extraction
├── test_crypto.py # CoinGecko, DeFi Llama clients
├── test_exa.py # Exa search client
├── test_github.py # GitHub search and code search
├── test_media.py # YouTube search and transcription
├── test_x_search.py # X/Twitter search via xAI
└── ...End-to-End Tests
tests/e2e/
└── ... # Full pipeline integration testsTest Architecture
Tests use pytest with pytest-asyncio for async tests. Key patterns:
- Mocked LLM calls — all litellm calls are mocked to avoid API costs
- Mocked HTTP clients — external API calls (Exa, CoinGecko, etc.) are mocked
- In-memory database — database tests use a test PostgreSQL or mock the db module
- FastAPI TestClient — API tests use Starlette's TestClient for synchronous HTTP testing
Running Specific Categories
# API tests only
pytest tests/test_api.py tests/test_api_new.py -v
# Crypto tests only
pytest tests/test_crypto_research.py tests/test_clients/test_crypto.py -v
# Research engine
pytest tests/test_research_engine.py -v
# Memory and knowledge base
pytest tests/test_memory.py -v
# Export formats
pytest tests/test_export.py -vCoverage
pytest --cov=app --cov-report=html
open htmlcov/index.html