placebo
Make boto3 calls that look real but have no effect
What it is and what it does
Placebo is a mocking library that intercepts AWS API calls and replays recorded responses instead of hitting real endpoints. It works by attaching to a Session and using the event system to capture and store responses as JSON or pickle files, then replay them deterministically during test runs. This lets you write integration-style tests without incurring API costs or network latency, and without manually constructing mock responses.
The library supports recording all services or filtering by service and operation name, manual response injection, and a decorator-based test interface with environment variables for record/playback mode selection. It has no runtime dependencies, making it lightweight to add to existing projects.
Use it for:
- Unit testing code that calls AWS services without making real API calls or incurring costs.
- Recording API interactions once in development, then replaying them consistently in CI/CD pipelines.
- Building deterministic test suites where response order and timing are predictable and reproducible.
- Mocking complex responses with nested structures that would be tedious to construct manually in test code.
- Testing legacy code that uses the default session without refactoring it to accept an injected session object.
Worth the install?
AI-flagged interpretation of the facts on this page — verify before relying
Placebo records and replays AWS API calls without hitting actual endpoints, enabling you to mock interactions in tests by saving responses to JSON or pickle files.
No. The package is abandoned (last commit 2021-09-28) with no maintenance or compatibility updates. While it works for basic mocking, you risk incompatibility with newer versions and lack of support for bugs or edge cases. Actively maintained alternatives exist for this use case.
Install
placebo on PyPI
pip
pip install placebouv
uv add placebopoetry
poetry add placeboInstalling placebo
Before you install
Install friction is high due to source-only distribution. The package is abandoned—last commit was 2021-09-28, over 1781 days ago—so expect no maintenance, bug fixes, or compatibility updates.
License in practice
Licensed under Apache License 2.0 (permissive), so you can use it freely in commercial and open-source projects without restriction, though you must include a copy of the license.
Quickstart
import placebo
session = boto3.Session()
pill = placebo.attach(session, data_path='/path/to/responses')
pill.record()
# Make calls; responses are recorded
# Later, to replay:
pill.playback()
# Calls return recorded responses
Requires a boto3 Session object to attach to; placebo itself has no runtime dependencies but is tightly coupled to the botocore event system.
Verify before relying
- Whether placebo remains compatible with current boto3 versions given its abandoned status since 2021.
- Whether the package works with Python versions beyond 3.9 (classifiers list up to 3.9 only).
- Performance or behavioral differences when using pickle vs. JSON response format in large test suites.
Package facts
| License | Apache License 2.0 (permissive) |
| Python support | not specified |
| Install friction | high — source build required |
| Runtime dependencies | none |
| Maintenance | abandoned — 1,781 days since the last release |
| Last repo commit | |
| First released | |
| Downloads | 227,507/month — #9,176 on PyPI (30-day window, as of 2026-08-14) |
| Known vulnerabilities | none known (OSV.dev, checked 2026-08-14) |
Evidence: placebo-0.10.0.tar.gz
Tags
More Testing packages
Pluggy provides a plugin system that lets you…
permissive · top 100 on PyPI
pytestpytest is a testing framework that lets you…
permissive · top 100 on PyPI
virtualenvvirtualenv creates isolated Python environments…
permissive · top 100 on PyPI
coverageCoverage.py measures which lines of Python code…
permissive · top 1,000 on PyPI
pytest-asynciopytest-asyncio is a pytest plugin that enables…
permissive · top 1,000 on PyPI
pytest-json-ctrfA pytest plugin that generates test reports in…
permissive · top 1,000 on PyPI
moto-extMocks AWS services for testing by intercepting…
permissive · top 15,000 on PyPI
betamaxBetamax records and replays HTTP interactions…
permissive · top 15,000 on PyPI
vcrpyVCR.py records HTTP interactions during test…
permissive · top 1,000 on PyPI
motoMoto mocks AWS services for testing, allowing…
permissive · top 1,000 on PyPI
pretendPretend provides a lightweight library for…
permissive · top 15,000 on PyPI
aws-assume-role-libSimplifies AWS role assumption in boto3 by…
permissive · top 15,000 on PyPI
asciinemaRecords and replays terminal sessions, saving…
copyleft · top 5,000 on PyPI
pytest-vcrA pytest plugin that integrates VCR.py to…
permissive · top 5,000 on PyPI
boto3-assumeWraps boto3 to create AWS IAM assume-role…
permissive · top 15,000 on PyPI
aiomotoProvides async-compatible AWS service mocks for…
permissive · top 15,000 on PyPI