Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

bugfix for #811 #812

Merged
merged 2 commits into from
Jun 4, 2020
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 3 additions & 3 deletions aiobotocore/session.py
Original file line number Diff line number Diff line change
Expand Up @@ -136,9 +136,9 @@ async def get_service_data(self, service_name, api_version=None):
api_version=api_version
)
service_id = EVENT_ALIASES.get(service_name, service_name)
self._events.emit('service-data-loaded.%s' % service_id,
service_data=service_data,
service_name=service_name, session=self)
await self._events.emit('service-data-loaded.%s' % service_id,
service_data=service_data,
service_name=service_name, session=self)
return service_data

async def get_available_regions(self, service_name, partition_name='aws',
Expand Down
16 changes: 16 additions & 0 deletions tests/test_session.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
import pytest


@pytest.mark.moto
@pytest.mark.asyncio
async def test_get_service_data(session):
handler_called = False

def handler(**kwargs):
nonlocal handler_called
handler_called = True

session.register('service-data-loaded.s3', handler)
await session.get_service_data('s3')

assert handler_called