Skip to content

Commit

Permalink
Merge pull request #1140 from jakob-keller/fix-create_waiter_with_client
Browse files Browse the repository at this point in the history
Fix `create_waiter_with_client()`
  • Loading branch information
jakob-keller authored Aug 17, 2024
2 parents 54a110b + 280d7b7 commit 6827354
Show file tree
Hide file tree
Showing 3 changed files with 31 additions and 1 deletion.
1 change: 1 addition & 0 deletions CHANGES.rst
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@ Changes

2.13.3 (2024-08-18)
^^^^^^^^^^^^^^^^^^^
* fix ``create_waiter_with_client()``

2.13.2 (2024-07-18)
^^^^^^^^^^^^^^^^^^^
Expand Down
4 changes: 3 additions & 1 deletion aiobotocore/waiter.py
Original file line number Diff line number Diff line change
Expand Up @@ -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(
Expand Down
27 changes: 27 additions & 0 deletions tests/test_waiter.py
Original file line number Diff line number Diff line change
@@ -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
Expand Down

0 comments on commit 6827354

Please sign in to comment.