moto-ext
A library that allows you to easily mock out tests based on AWS infrastructure
What it is and what it does
Moto-ext is a fork of Moto that mocks AWS services for local testing. It intercepts boto3 calls and simulates AWS behavior in-process, letting you test code that depends on AWS without provisioning real infrastructure or incurring costs. The fork includes patches tailored for LocalStack for AWS.
You use it by decorating test functions or context managers to enable mocking for specific services (S3, EC2, DynamoDB, etc.). Your boto3 client calls then hit the mock instead of AWS. It supports a broad surface of AWS services and maintains active development with recent releases.
Use it for:
- Unit test code that reads/writes to S3 without creating real buckets or objects.
- Test EC2 instance lifecycle logic (launch, terminate, describe) in isolation.
- Mock DynamoDB tables and queries for rapid iteration on data layer code.
- Integration test multi-service workflows (e.g., Lambda triggering SNS) locally.
- Validate IAM policy logic and role assumptions before deployment.
Worth the install?
AI-flagged interpretation of the facts on this page — verify before relying
Mocks AWS services for testing by intercepting boto3 calls, allowing you to test AWS-dependent code without hitting real AWS infrastructure.
Yes. Active maintenance, low friction, permissive license, and no known vulnerabilities make this a solid choice for local AWS testing. The fork's LocalStack patches add value if you use LocalStack; otherwise, consider whether the upstream Moto project better suits your needs.
Install
moto-ext on PyPI
pip
pip install moto-extuv
uv add moto-extpoetry
poetry add moto-extInstalling moto-ext
Before you install
Active maintenance with a release 4 days ago. Low install friction via a pure-Python wheel. Depends on boto3, botocore, and several common libraries (cryptography, requests, werkzeug, Jinja2, responses) that are widely used and well-maintained.
License in practice
Licensed under Apache-2.0 (permissive), allowing use in commercial and proprietary projects with minimal restrictions.
Quickstart
pip install moto-ext
from moto import mock_s3
import boto3
@mock_s3
def test_s3():
client = boto3.client('s3', region_name='us-east-1')
client.create_bucket(Bucket='test-bucket')
response = client.list_buckets()
assert len(response['Buckets']) == 1
Requires Python 3.9 or later.
Verify before relying
- Whether all LocalStack patches are documented or discoverable compared to upstream Moto.
- Performance characteristics when mocking large numbers of AWS resources or complex state.
- Compatibility guarantees with specific AWS service versions or boto3 releases.
Package facts
| License | Apache-2.0 (permissive) |
| Python support | supports the current Python release (>=3.9) |
| Install friction | low — pure-Python wheel |
| Runtime dependencies | 9 — boto3, botocore, cryptography, requests, xmltodict, werkzeug, python-dateutil, responses, Jinja2 |
| Maintenance | actively maintained — 4 days since the last release |
| Last repo commit | |
| First released | |
| Downloads | 253,622/month — #8,513 on PyPI (30-day window, as of 2026-08-14) |
| Known vulnerabilities | none known (OSV.dev, checked 2026-08-14) |
Evidence: moto_ext-5.1.45-py3-none-any.whl
Keywords: aws, ec2, s3, boto3, mock
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
aiomotoProvides async-compatible AWS service mocks for…
permissive · top 15,000 on PyPI
localstack-clientA Python client that wraps boto3 to redirect…
permissive · top 5,000 on PyPI
motoMoto mocks AWS services for testing, allowing…
permissive · top 1,000 on PyPI
placeboPlacebo records and replays AWS API calls…
permissive · top 15,000 on PyPI
localstackLocalStack is a command-line tool that emulates…
permissive · top 15,000 on PyPI
localstack-extProvides extensions and additional…
unclear · top 15,000 on PyPI
terraform-localA wrapper script that runs Terraform against…
permissive · top 15,000 on PyPI
mocketMocket is a socket mocking framework that…
permissive · top 15,000 on PyPI
responsesMocks HTTP requests made by the requests…
permissive · top 1,000 on PyPI
httmockIntercepts and mocks HTTP requests made by the…
permissive · top 5,000 on PyPI