{"id":18358534,"url":"https://github.com/mintel/pytest-localstack","last_synced_at":"2025-04-10T03:54:43.984Z","repository":{"id":45173488,"uuid":"122692607","full_name":"mintel/pytest-localstack","owner":"mintel","description":"Pytest plugin for local AWS integration tests","archived":false,"fork":false,"pushed_at":"2023-10-19T04:16:51.000Z","size":432,"stargazers_count":78,"open_issues_count":19,"forks_count":21,"subscribers_count":8,"default_branch":"master","last_synced_at":"2025-04-10T03:54:39.895Z","etag":null,"topics":["amazon-web-services","aws","pytest","pytest-plugin","python","testing","testing-tools"],"latest_commit_sha":null,"homepage":"","language":"Python","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/mintel.png","metadata":{"files":{"readme":"README.rst","changelog":"CHANGELOG.rst","contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2018-02-24T01:57:31.000Z","updated_at":"2024-09-10T04:58:03.000Z","dependencies_parsed_at":"2024-06-19T09:58:01.841Z","dependency_job_id":"323221bf-f95f-424c-a027-c4af5487bce8","html_url":"https://github.com/mintel/pytest-localstack","commit_stats":{"total_commits":143,"total_committers":10,"mean_commits":14.3,"dds":0.1748251748251748,"last_synced_commit":"a1fa61dfd5a182b0f0ef365115c797b251e65c04"},"previous_names":[],"tags_count":16,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/mintel%2Fpytest-localstack","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/mintel%2Fpytest-localstack/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/mintel%2Fpytest-localstack/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/mintel%2Fpytest-localstack/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/mintel","download_url":"https://codeload.github.com/mintel/pytest-localstack/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":248154999,"owners_count":21056542,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["amazon-web-services","aws","pytest","pytest-plugin","python","testing","testing-tools"],"created_at":"2024-11-05T22:18:20.250Z","updated_at":"2025-04-10T03:54:43.961Z","avatar_url":"https://github.com/mintel.png","language":"Python","funding_links":[],"categories":[],"sub_categories":[],"readme":"pytest-localstack\n=================\n\n.. image:: https://img.shields.io/pypi/v/pytest-localstack.svg\n    :alt: PyPI\n    :target: https://pypi.org/project/pytest-localstack/\n\n.. image:: https://img.shields.io/travis/mintel/pytest-localstack/master.svg\n    :alt: Travis-CI\n    :target: https://travis-ci.org/mintel/pytest-localstack\n\n.. image:: https://img.shields.io/codecov/c/github/mintel/pytest-localstack.svg\n    :alt: Codecov\n    :target: https://codecov.io/gh/mintel/pytest-localstack\n\n.. image:: https://img.shields.io/github/license/mintel/pytest-localstack.svg\n    :target: https://github.com/mintel/pytest-localstack/blob/master/LICENSE\n\n.. image:: https://img.shields.io/github/issues/mintel/pytest-localstack.svg\n    :target: https://github.com/mintel/pytest-localstack/issues\n\n.. image:: https://img.shields.io/github/forks/mintel/pytest-localstack.svg\n    :target: https://github.com/mintel/pytest-localstack/network\n\n.. image:: https://img.shields.io/github/stars/mintel/pytest-localstack.svg\n    :target: https://github.com/mintel/pytest-localstack/stargazers\n\npytest-localstack is a plugin for pytest_ to create AWS_ integration tests\nvia a Localstack_ Docker container.\n\n`Read The Docs`_\n\n**Requires:**\n\n- pytest \u003e= 3.3.0\n- Docker\n\nTested against Python \u003e= 3.6.\n\n.. _pytest: http://docs.pytest.org/\n.. _AWS: https://aws.amazon.com/\n.. _Localstack: https://github.com/localstack/localstack\n.. _Read the Docs: https://pytest-localstack.readthedocs.io/\n\n\nFeatures\n--------\n* Create `pytest fixtures`_ that start and stop a Localstack container.\n* Temporarily patch botocore to redirect botocore/boto3 API calls to Localstack container.\n* Plugin system to easily extend supports to other AWS client libraries such as aiobotocore_.\n\n.. _pytest fixtures: https://docs.pytest.org/en/stable/fixture.html\n\nExample\n-------\n.. code-block:: python\n\n    import boto3\n    import pytest_localstack\n\n    localstack = pytest_localstack.patch_fixture(\n        services=[\"s3\"],  # Limit to the AWS services you need.\n        scope='module',  # Use the same Localstack container for all tests in this module.\n        autouse=True,  # Automatically use this fixture in tests.\n    )\n\n    def test_s3_bucket_creation():\n        s3 = boto3.resource('s3')  # Botocore/boto3 will be patched to use Localstack\n        assert len(list(s3.buckets.all())) == 0\n        bucket = s3.Bucket('foobar')\n        bucket.create()\n        assert len(list(s3.buckets.all())) == 1\n\nServices\n--------\n* apigateway\n* cloudformation\n* cloudwatch\n* dynamodb\n* dynamodbstreams\n* ec2\n* es\n* firehose\n* iam\n* kinesis\n* lambda\n* logs\n* redshift\n* route53\n* s3\n* secretsmanager\n* ses\n* sns\n* sqs\n* ssm\n* stepfunctions\n* sts\n\nInstallation\n------------\n.. code-block:: bash\n\n    $ pip install pytest-localstack\n\n\nTODO\n----\n\n* More detailed docs.\n* Break Docker container running out of LocalstackSession.\n* Make botocore patching more comprehensible.\n* Add common test resource fixture factories i.e. S3 buckets, SQS queues, SNS topics, etc.\n* Test this works for non-localhost Docker containers.\n* Add other client libraries such as aiobotocore_.\n\n.. _aiobotocore: https://github.com/aio-libs/aiobotocore\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fmintel%2Fpytest-localstack","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fmintel%2Fpytest-localstack","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fmintel%2Fpytest-localstack/lists"}