Test your AWS applications with realistic in-process local services using a native language SDK. No external process, no ports, no Docker required — services run as threads inside your test suite.
pytest integration, DynamoDB / SQS / S3 helpers, fluent faking and chaos APIs
Jest / Vitest integration, AWS SDK v3 clients, faking and chaos APIs
Jest / Mocha integration, AWS SDK v3 clients, automatic endpoint redirection via env vars
JUnit 5 integration for Java and Kotlin projects, AWS SDK v2 clients, try-with-resources lifecycle
Go testing package integration, AWS SDK v2 clients, auto-discovery from HCL
/_ldk/guisession.reset()The Python SDK (local-web-services-python-sdk) provides everything you need to test AWS-backed Python applications without leaving your pytest suite.
A single context manager that starts all your services. Declare tables, queues, buckets, topics, state machines, parameters, and secrets — or auto-discover them from a CDK or HCL project.
Zero-boilerplate pytest integration. The lws_session fixture starts services once per session; lws_reset wipes state between tests automatically.
Simplified DynamoDB, SQS, and S3 helpers with built-in assertion methods: table.assert_item_exists(), queue.assert_message_count(), bucket.assert_object_count().
Override any AWS operation response with a fluent builder. Inject throttling errors, custom status codes, or delayed responses at the operation level without changing application code.
Inject error rates, latency ranges, connection resets, and timeouts into any service. Apply and clear chaos scenarios programmatically within individual test functions.
Switch IAM modes to disabled, audit, or enforce. Define named identities with inline allow/deny policies and verify authorization behavior in tests.
Install the SDK and write your first test in minutes.
pip install local-web-services-python-sdk
# or with uv
uv add local-web-services-python-sdk
from lws_testing import LwsSession
with LwsSession(
tables=[{"name": "Orders", "partition_key": "id"}],
queues=["OrderQueue"],
buckets=["ReceiptsBucket"],
) as session:
# services are running
pass
def test_create_order(lws_session):
# Use a boto3 client pointing to local services
client = lws_session.client("dynamodb")
client.put_item(
TableName="Orders",
Item={"id": {"S": "42"}, "status": {"S": "pending"}}
)
# Or use the DynamoDB helper with assertions
table = lws_session.dynamodb("Orders")
table.assert_item_exists({"id": {"S": "42"}})
# conftest.py
import pytest
from lws_testing import LwsSession
@pytest.fixture(scope="session")
def lws_session_spec():
return {
"tables": [{"name": "Orders", "partition_key": "id"}],
"queues": ["OrderQueue"],
"buckets": ["ReceiptsBucket"],
}
# lws_session and lws_reset fixtures are provided
# automatically by the lws_testing pytest plugin