diff --git a/CHANGES.rst b/CHANGES.rst index 4a76d59a..6ecdcb13 100644 --- a/CHANGES.rst +++ b/CHANGES.rst @@ -3,6 +3,7 @@ Changes 2.13.3 (2024-08-18) ^^^^^^^^^^^^^^^^^^^ +* fix ``create_waiter_with_client()`` 2.13.2 (2024-07-18) ^^^^^^^^^^^^^^^^^^^ diff --git a/aiobotocore/waiter.py b/aiobotocore/waiter.py index 7f51a2ae..989c53a5 100644 --- a/aiobotocore/waiter.py +++ b/aiobotocore/waiter.py @@ -63,7 +63,9 @@ async def wait(self, **kwargs): ) # Create the new waiter class - documented_waiter_cls = type(waiter_class_name, (Waiter,), {'wait': wait}) + documented_waiter_cls = type( + waiter_class_name, (AIOWaiter,), {'wait': wait} + ) # Return an instance of the new waiter class. return documented_waiter_cls( diff --git a/tests/test_waiter.py b/tests/test_waiter.py index 1997ae97..387f466a 100644 --- a/tests/test_waiter.py +++ b/tests/test_waiter.py @@ -1,5 +1,32 @@ +import asyncio + import pytest +from aiobotocore.waiter import ( + AIOWaiter, + WaiterModel, + create_waiter_with_client, +) + + +@pytest.fixture +def cloudformation_waiter_model(cloudformation_client): + config = cloudformation_client._get_waiter_config() + return WaiterModel(config) + + +@pytest.mark.moto +def test_create_waiter_with_client( + cloudformation_client, cloudformation_waiter_model +): + waiter = create_waiter_with_client( + 'StackCreateComplete', + cloudformation_waiter_model, + cloudformation_client, + ) + assert isinstance(waiter, AIOWaiter) + assert asyncio.iscoroutinefunction(waiter.wait) + @pytest.mark.moto @pytest.mark.asyncio