1
0
mirror of https://github.com/home-assistant/core.git synced 2025-12-24 12:59:34 +00:00

Only create a single resolver object if there are multiple aiohttp sessions (#144090)

This commit is contained in:
J. Nick Koston
2025-05-02 13:43:06 -05:00
committed by GitHub
parent 97be2c4ac9
commit 2890fc7dd2
3 changed files with 48 additions and 4 deletions

View File

@@ -1319,9 +1319,11 @@ def disable_translations_once(
@pytest_asyncio.fixture(autouse=True, scope="session", loop_scope="session")
async def mock_zeroconf_resolver() -> AsyncGenerator[_patch]:
"""Mock out the zeroconf resolver."""
resolver = AsyncResolver()
resolver.real_close = resolver.close
patcher = patch(
"homeassistant.helpers.aiohttp_client._async_make_resolver",
return_value=AsyncResolver(),
return_value=resolver,
)
patcher.start()
try: