A Python library for mocking AWS services in unit tests, enabling local testing without real AWS infrastructure.
Moto is a Python library that mocks AWS services, enabling developers to test code that uses AWS without connecting to real AWS infrastructure. It intercepts boto3 calls and simulates AWS behavior locally, allowing for fast, reliable, and cost-free unit tests. The library supports a wide range of AWS services and maintains resource state across mocked operations.
Python developers and DevOps engineers who write applications or scripts using AWS services and need to test them in isolation without relying on actual AWS resources.
Developers choose Moto because it provides a simple, decorator-based way to mock AWS services with high fidelity, reducing test flakiness, eliminating costs, and enabling offline testing. Its compatibility with boto3 and support for many AWS services make it a go-to tool for AWS-focused unit testing.
A library that allows you to easily mock out tests based on AWS infrastructure.
Open-Awesome is built by the community, for the community. Submit a project, suggest an awesome list, or help improve the catalog on GitHub.
Uses Python decorators like @mock_aws to easily wrap test functions, minimizing code changes as shown in the README example with S3.
Maintains the state of AWS resources such as S3 buckets and DynamoDB tables across mocked calls, enabling realistic test scenarios like object storage.
Supports a broad range of AWS services including EC2, S3, and Lambda, with many API operations covered, as indicated by the implementation coverage document.
Allows tests to run without internet access or AWS credentials, eliminating costs and enabling reliable CI/CD pipeline execution, as emphasized in the description.
Not all AWS services or operations are fully mocked, which can lead to gaps in testing coverage for less common or newer features, as noted in the implementation coverage.
AWS frequently updates its APIs, and moto may not keep pace, potentially causing tests to pass with mocks but fail against real services due to outdated simulations.
The simulated behavior might not perfectly match AWS's actual responses, especially for edge cases or complex service interactions, risking false positives in tests.