moto
A library that allows you to easily mock out tests based on AWS infrastructure
Decision gist · record as of 2026-08-14
Yes. Moto is a mature, actively maintained library in the top 1000 PyPI packages with no known vulnerabilities. It has low install friction, permissive licensing, and solves a real problem: testing AWS-dependent code without infrastructure costs or external dependencies. Install it if you write code that calls boto3.AI-flagged interpretation of the facts on this page — verify before relying
Before you install
- Requires Python 3.10 or later.
- Low friction: pure Python wheel with well-established dependencies (boto3, botocore, cryptography, requests, xmltodict, werkzeug, responses).
- Active maintenance with recent releases and 8613 repository stars.
License · maintenance · safety
Apache-2.0 (permissive) — Apache-2.0 is permissive; you can use this in commercial projects without restriction, though you must include a copy of the license.
last release 2026-06-06 (69 days) · last repo commit 2026-08-11 · 8,613 stars
0 known vulnerabilities (OSV.dev, 2026-08-14) · 47,377,426 downloads/mo, #600 on PyPI
Alternatives
Verify before relying
pip install moto
import boto3
from moto import mock_aws
@mock_aws
def test_example():
s3 = boto3.client('s3', region_name='us-east-1')
s3.create_bucket(Bucket='test-bucket')
# Test code here- Which AWS services and features are fully mocked versus partially supported or stubbed.
- Whether moto's mocked behavior matches real AWS behavior in edge cases or error conditions.
- Performance overhead of moto's state tracking during large test suites.
What it is and what it does
Moto is a testing library that intercepts boto3 calls and replaces them with in-memory mocks of AWS services. Instead of making real API calls to AWS, your tests run against moto's virtual AWS account, which tracks state (buckets, keys, instances, etc.) in memory. This lets you test AWS-dependent code without credentials, network calls, or AWS charges.
You use it by decorating test functions with @mock_aws or by using it as a context manager. Moto supports multiple AWS services (EC2, S3, and others documented in its implementation coverage guide). The library depends on boto3, botocore, and several HTTP/parsing utilities to intercept and simulate AWS responses.
Use it for
- Unit test code that uploads files to S3 without creating real buckets or incurring storage costs.
- Test EC2 instance lifecycle code (launch, terminate, describe) in isolation without AWS credentials.
- Run CI/CD pipelines that exercise AWS-dependent code without network access or AWS account setup.
- Develop and iterate on AWS integrations locally before deploying to a real environment.
- Test error handling and edge cases in AWS code without risking data or incurring charges.
Worth the install?
AI-flagged interpretation of the facts on this page. Verify before relying on it.
Yes.
Moto is a mature, actively maintained library in the top 1000 PyPI packages with no known vulnerabilities. It has low install friction, permissive licensing, and solves a real problem: testing AWS-dependent code without infrastructure costs or external dependencies. Install it if you write code that calls boto3.
Install
moto on PyPI
Before you install
Low friction: pure Python wheel with well-established dependencies (boto3, botocore, cryptography, requests, xmltodict, werkzeug, responses). Active maintenance with recent releases and 8613 repository stars.
Requires Python 3.10 or later.
License in practice
Apache-2.0 is permissive; you can use this in commercial projects without restriction, though you must include a copy of the license.
Quickstart
pip install moto
import boto3
from moto import mock_aws
@mock_aws
def test_example():
s3 = boto3.client('s3', region_name='us-east-1')
s3.create_bucket(Bucket='test-bucket')
# Test code here
Verify before relying
- Which AWS services and features are fully mocked versus partially supported or stubbed.
- Whether moto's mocked behavior matches real AWS behavior in edge cases or error conditions.
- Performance overhead of moto's state tracking during large test suites.
Package facts
| License | Apache-2.0 permissive |
| Python support | Supports the current Python release >=3.10 |
| Install friction | Low. Pure-Python wheel |
| Runtime dependencies | 7 packagesboto3botocorecryptographyrequestsxmltodictwerkzeugresponses |
| Maintenance | Actively maintained 69 days since the last release |
| Last repo commit | |
| First released | |
| Downloads | 47,377,426 / month, #600 on PyPI 30-day window, as of 2026-08-14 |
| Known vulnerabilities | None known OSV.dev, checked 2026-08-14 |
| Classifiers | Programming Language :: Python :: 3Programming Language :: Python :: 3.10Programming Language :: Python :: 3.11Programming Language :: Python :: 3.12Programming Language :: Python :: 3.13Programming Language :: Python :: 3.14Topic :: Software Development :: Testing |
Evidence: moto-5.2.2-py3-none-any.whl
Tags
Let your AI agent find packages like this
Example. Real query, live index.
You found this page by searching. An agent finds it by wishing: SkillFed indexes 14,416 PyPI packages by what they can do, searchable in plain language.
wish › “aws service mocks”
- motoMoto mocks AWS services for testing, allowing you to test code that…
- aiomotoProvides async-compatible AWS service mocks for aiobotocore that…
- moto-extMocks AWS services for testing by intercepting boto3 calls, allowing…
Give your agent the search over MCP, or paste the wish link into any chat.
More Testing packages
Pluggy provides a plugin system that lets you define hook specifications and register implementations to be called in sequence, enabling extensible Python applications without tight coupling.
Install it if you're building an extensible application or framework.
pytest is a testing framework that lets you write test functions using plain assert statements and automatically discovers and runs them, with detailed failure reporting.
virtualenv creates isolated Python environments where packages can be installed independently without affecting the system Python or other projects.
Coverage.py measures which lines of Python code are executed during test runs, reporting coverage percentages and identifying untested code paths.
Install it if you want to measure test completeness or enforce coverage thresholds in your project.
pytest-asyncio is a pytest plugin that enables writing and running async test functions using the asyncio library, allowing developers to await code directly within test cases.
Install it if you write tests for any asyncio-based code.
A pytest plugin that generates test reports in Common Test Report Format (CTRF) as JSON, compatible with pytest-xdist and pytest-playwright for distributed and browser-based testing.
Install it if you need CTRF-formatted test output for CI/CD integration or cross-tool reporting.
See also aiomoto · moto-ext · boto3 · placebo · localstack-client · mock-firestore · aiobotocore · boto · flexmock · mocket