Python Test Samples Starter ProjectIntroduction1 min

This project contains automated test code samples for serverless applications written in Python. The project demonstrates several techniques for executing tests including mocking, emulation and testing in the cloud. Based on current tooling, we recommend customers focus on testing in the cloud as much as possible.

Testing in the Cloud

While testing in the cloud may create additional developer latency, have a cost impact, and require some customers to invest in additional dev-ops controls, this technique provides the most reliable, accurate, and complete test coverage. Performing tests in the cloud allows you to test IAM policies, service configurations, quotas, and the most up-to-date API signatures and return values. Tests run in the cloud are most likely to produce consistent results as you promote your code from environment to environment.

How do I use this guide?

  • If you want to follow along with the testing approaches in this guide, clone the project from the GitHub repository and go through the instructions on this guide.

git clone https://github.com/aws-samples/serverless-test-samples cd serverless-test-samples/python-test-samples/apigw-lambda

  • If you want to learn how to test your own Python application, you can read the guide and adopt the approaches into your development workflow.

Created by:

Dan Fox
Dan FoxDan Fox is a Principal Specialist Solutions Architect at AWS. Dan works with customers to help them leverage serverless services to build scalable, fault-tolerant, high-performing, cost-effective applications.
Rohan Mehta
Rohan MehtaAssociate Cloud Application Architect at AWS.