Skip to content
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
3 changes: 1 addition & 2 deletions docs/reference/async.md
Original file line number Diff line number Diff line change
Expand Up @@ -34,8 +34,7 @@ async def main():
)
print(resp)

loop = asyncio.get_event_loop()
loop.run_until_complete(main())
asyncio.run(main())
```

All APIs that are available under the sync client are also available under the async client.
Expand Down
6 changes: 4 additions & 2 deletions test_elasticsearch/test_async/test_transport.py
Original file line number Diff line number Diff line change
Expand Up @@ -527,7 +527,8 @@ async def test_sniff_on_node_failure_triggers(self, extra_key, extra_value):
assert request_failed_in_error
assert len(client.transport.node_pool) == 3

async def test_sniff_after_n_seconds(self, event_loop):
async def test_sniff_after_n_seconds(self):
event_loop = asyncio.get_running_loop()
client = AsyncElasticsearch( # noqa: F821
[NodeConfig("http", "localhost", 9200, _extras={"data": CLUSTER_NODES})],
node_class=DummyNode,
Expand Down Expand Up @@ -579,7 +580,8 @@ async def test_sniffing_disabled_on_elastic_cloud(self, kwargs):
== "Sniffing should not be enabled when connecting to Elastic Cloud"
)

async def test_sniff_on_start_close_unlocks_async_calls(self, event_loop):
async def test_sniff_on_start_close_unlocks_async_calls(self):
event_loop = asyncio.get_running_loop()
client = AsyncElasticsearch( # noqa: F821
[
NodeConfig(
Expand Down
Loading