Unit Tests¶
Quick Start¶
# Run all unit tests
uv run pytest tests/unit/ -v
# Run specific test file
uv run pytest tests/unit/test_gtm_sampling.py -v
# Run with coverage
uv run pytest tests/unit/ --cov=src/cs_copilot --cov-report=html
Quick Validation¶
# Test basic infrastructure (3 seconds)
uv run python test_simple.py
# Test single prompt robustness (15 seconds)
uv run python test_robustness_minimal.py
Pre-commit Hooks¶
Pre-commit runs:
- Black (code formatting on
src/andtests/only) - File checks (trailing whitespace, large files, merge conflicts)
- Unit tests (
tests/unit/)
Linting and Formatting¶
# Format code with Black
uv run black src/ tests/
# Run Ruff linter
uv run ruff check src/ tests/ --fix
# Sort imports
uv run isort src/ tests/