# moto-testkit
**moto-testkit** is an enhanced testing toolkit built on top of [moto](https://github.com/getmoto/moto), providing:
- Easy setup for **unit tests** (Pytest + Unittest).
- Support for **sync and async workflows**.
- Ready-to-use **helpers** for AWS services.
- A full **examples/** directory with practical test cases.
---
## 🚀 Benefits over `moto`
- ✅ Simplified setup for both sync & async tests.
- ✅ Preconfigured decorators and fixtures for Pytest & Unittest.
- ✅ Rich **examples** for DynamoDB, S3, and other AWS services.
- ✅ Helpers for repetitive patterns (table creation, sessions, contexts).
---
## 📂 Examples
Check the [examples/](examples) folder for:
- **Pytest usage** with async/sync.
- **Unittest usage** with decorators.
- **Service-specific helpers**.
```python
import unittest
from moto_testkit import use_moto_testkit
@use_moto_testkit(auto_start=True)
class TestDynamoDB(unittest.TestCase):
def setUp(self):
self.repo.create_table(
table_name="Users",
key_schema=[{"AttributeName": "id", "KeyType": "HASH"}],
attribute_definitions=[{"AttributeName": "id", "AttributeType": "S"}]
)
def test_insert_user(self):
self.repo.put_item(table_name="Users", item={"id": "123", "name": "Alice"})
result = self.repo.get_item(table_name="Users", key={"id": "123"})
assert result["Item"]["name"] == "Alice"
Raw data
{
"_id": null,
"home_page": "https://github.com/RafaeldaSilvaa/moto-testkit",
"name": "moto-testkit",
"maintainer": null,
"docs_url": null,
"requires_python": ">=3.8",
"maintainer_email": null,
"keywords": "aws, testing, moto, pytest, unittest, dynamodb, s3, asyncio",
"author": "Rafael da Silva",
"author_email": "Rafael da Silva <rafaeldasilva.98@hotmail.com>",
"download_url": "https://files.pythonhosted.org/packages/24/5b/e81d40b6fad1c6d8e5426fa87cbff783654d66d23b59d1c82276516a4daf/moto_testkit-0.1.3.tar.gz",
"platform": null,
"description": "# moto-testkit\n\n**moto-testkit** is an enhanced testing toolkit built on top of [moto](https://github.com/getmoto/moto), providing:\n- Easy setup for **unit tests** (Pytest + Unittest).\n- Support for **sync and async workflows**.\n- Ready-to-use **helpers** for AWS services.\n- A full **examples/** directory with practical test cases.\n\n---\n\n## \ud83d\ude80 Benefits over `moto`\n- \u2705 Simplified setup for both sync & async tests.\n- \u2705 Preconfigured decorators and fixtures for Pytest & Unittest.\n- \u2705 Rich **examples** for DynamoDB, S3, and other AWS services.\n- \u2705 Helpers for repetitive patterns (table creation, sessions, contexts).\n\n---\n\n## \ud83d\udcc2 Examples\nCheck the [examples/](examples) folder for:\n- **Pytest usage** with async/sync.\n- **Unittest usage** with decorators.\n- **Service-specific helpers**.\n\n```python\nimport unittest\nfrom moto_testkit import use_moto_testkit\n\n@use_moto_testkit(auto_start=True)\nclass TestDynamoDB(unittest.TestCase):\n def setUp(self):\n self.repo.create_table(\n table_name=\"Users\",\n key_schema=[{\"AttributeName\": \"id\", \"KeyType\": \"HASH\"}],\n attribute_definitions=[{\"AttributeName\": \"id\", \"AttributeType\": \"S\"}]\n )\n\n def test_insert_user(self):\n self.repo.put_item(table_name=\"Users\", item={\"id\": \"123\", \"name\": \"Alice\"})\n result = self.repo.get_item(table_name=\"Users\", key={\"id\": \"123\"})\n assert result[\"Item\"][\"name\"] == \"Alice\"\n\n",
"bugtrack_url": null,
"license": null,
"summary": "An extended testkit for AWS services using moto, with sync/async helpers and examples.",
"version": "0.1.3",
"project_urls": {
"Homepage": "https://github.com/RafaeldaSilvaa/moto-testkit"
},
"split_keywords": [
"aws",
" testing",
" moto",
" pytest",
" unittest",
" dynamodb",
" s3",
" asyncio"
],
"urls": [
{
"comment_text": null,
"digests": {
"blake2b_256": "9a303613d3b9ef6b48f839812d6940b9a66ed460e55b20445e54a12adb633427",
"md5": "4f6552c1d71d548cf32c123988075fa2",
"sha256": "19ead3c9f2945bb81449f3dec2f4e08aae7f811a7d002114cb2d40b88c2d8e5e"
},
"downloads": -1,
"filename": "moto_testkit-0.1.3-py3-none-any.whl",
"has_sig": false,
"md5_digest": "4f6552c1d71d548cf32c123988075fa2",
"packagetype": "bdist_wheel",
"python_version": "py3",
"requires_python": ">=3.8",
"size": 2069,
"upload_time": "2025-08-28T05:43:05",
"upload_time_iso_8601": "2025-08-28T05:43:05.292681Z",
"url": "https://files.pythonhosted.org/packages/9a/30/3613d3b9ef6b48f839812d6940b9a66ed460e55b20445e54a12adb633427/moto_testkit-0.1.3-py3-none-any.whl",
"yanked": false,
"yanked_reason": null
},
{
"comment_text": null,
"digests": {
"blake2b_256": "245be81d40b6fad1c6d8e5426fa87cbff783654d66d23b59d1c82276516a4daf",
"md5": "1430811dfcf8ef933d5cd066bd0c3c83",
"sha256": "25f3314b2dfe968748cc6c660fe80392887b0f7072f84e4a0730c8cfb59c28d1"
},
"downloads": -1,
"filename": "moto_testkit-0.1.3.tar.gz",
"has_sig": false,
"md5_digest": "1430811dfcf8ef933d5cd066bd0c3c83",
"packagetype": "sdist",
"python_version": "source",
"requires_python": ">=3.8",
"size": 2604,
"upload_time": "2025-08-28T05:43:06",
"upload_time_iso_8601": "2025-08-28T05:43:06.035101Z",
"url": "https://files.pythonhosted.org/packages/24/5b/e81d40b6fad1c6d8e5426fa87cbff783654d66d23b59d1c82276516a4daf/moto_testkit-0.1.3.tar.gz",
"yanked": false,
"yanked_reason": null
}
],
"upload_time": "2025-08-28 05:43:06",
"github": true,
"gitlab": false,
"bitbucket": false,
"codeberg": false,
"github_user": "RafaeldaSilvaa",
"github_project": "moto-testkit",
"travis_ci": false,
"coveralls": false,
"github_actions": true,
"tox": true,
"lcname": "moto-testkit"
}