Skip to content

[8.18] Stop using event_loop fixture (#2969) #2973

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

Merged
merged 1 commit into from
May 30, 2025
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/guide/async.asciidoc
Original file line number Diff line number Diff line change
Expand Up @@ -37,8 +37,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
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 @@ -581,7 +582,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