Skip to content

Commit

Permalink
fix event loop warning from pytest
Browse files Browse the repository at this point in the history
  • Loading branch information
miguelgrinberg committed Jan 13, 2025
1 parent b3b423d commit 8b2191a
Showing 1 changed file with 4 additions and 2 deletions.
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

0 comments on commit 8b2191a

Please sign in to comment.