claude-code-sdk-python/examples
Ashwin Bhat a0ce44a3fa
Add Docker-based test infrastructure for e2e tests (#424)
## Summary

- Add `Dockerfile.test`: Python 3.12 image with Claude Code CLI
installed
- Add `scripts/test-docker.sh`: Local script to run tests in Docker
- Add `test-e2e-docker` job to CI workflow that runs the full e2e suite
in a container
- Add `.dockerignore` to speed up Docker builds

## Context

This helps catch Docker-specific issues like #406 where filesystem-based
agents loaded via `setting_sources=["project"]` may silently fail in
Docker environments.

## Local Usage

```bash
# Run unit tests in Docker (no API key needed)
./scripts/test-docker.sh unit

# Run e2e tests in Docker
ANTHROPIC_API_KEY=sk-... ./scripts/test-docker.sh e2e

# Run all tests
ANTHROPIC_API_KEY=sk-... ./scripts/test-docker.sh all
```

## Test plan

- [x] Unit tests pass in Docker locally (129 passed)
- [ ] CI job runs successfully

🤖 Generated with [Claude Code](https://claude.com/claude-code)

---------

Co-authored-by: Claude <noreply@anthropic.com>
2025-12-16 10:53:13 -08:00
..
plugins/demo-plugin feat: add plugin support to Python SDK (#285) 2025-10-24 15:29:01 -07:00
agents.py Rename claude_code to claude_agent (#188) 2025-09-28 14:52:53 -07:00
filesystem_agents.py Add Docker-based test infrastructure for e2e tests (#424) 2025-12-16 10:53:13 -08:00
hooks.py feat: add strongly-typed hook inputs with TypedDict (#240) 2025-10-10 16:22:13 -07:00
include_partial_messages.py Update model references to claude-sonnet-4-5 (#198) 2025-09-30 12:59:14 -07:00
max_budget_usd.py feat: add max_budget_usd option to Python SDK (#293) 2025-10-30 16:45:35 -07:00
mcp_calculator.py Rename claude_code to claude_agent (#188) 2025-09-28 14:52:53 -07:00
plugin_example.py feat: add plugin support to Python SDK (#285) 2025-10-24 15:29:01 -07:00
quick_start.py Rename claude_code to claude_agent (#188) 2025-09-28 14:52:53 -07:00
setting_sources.py Rename claude_code to claude_agent (#188) 2025-09-28 14:52:53 -07:00
stderr_callback_example.py Rename claude_code to claude_agent (#188) 2025-09-28 14:52:53 -07:00
streaming_mode.py Update model references to claude-sonnet-4-5 (#198) 2025-09-30 12:59:14 -07:00
streaming_mode_ipython.py Rename claude_code to claude_agent (#188) 2025-09-28 14:52:53 -07:00
streaming_mode_trio.py Update model references to claude-sonnet-4-5 (#198) 2025-09-30 12:59:14 -07:00
system_prompt.py Rename claude_code to claude_agent (#188) 2025-09-28 14:52:53 -07:00
tool_permission_callback.py Rename claude_code to claude_agent (#188) 2025-09-28 14:52:53 -07:00
tools_option.py feat: add tools option to ClaudeAgentOptions (#389) 2025-12-04 09:27:02 -08:00