skillfed

moto-ext

A library that allows you to easily mock out tests based on AWS infrastructure

moto-ext v5.1.45 253.6K downloads/30d#8,513 on PyPI27
Permissive license Apache-2.0 Active released

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-ext

uv

uv add moto-ext

poetry

poetry add moto-ext

Installing 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

Programming Language :: Python :: 3Programming Language :: Python :: 3.10Programming Language :: Python :: 3.11Programming Language :: Python :: 3.12Programming Language :: Python :: 3.13Programming Language :: Python :: 3.14Programming Language :: Python :: 3.9Topic :: Software Development :: Testing

Tags

aws mocking libraryboto3 mock testinglocal aws testingaws service simulationec2 s3 mockaws infrastructure testing
aws-testingmockinglocalstack

More Testing packages