1
0
mirror of https://github.com/home-assistant/core.git synced 2026-04-02 08:26:41 +01:00

Improve Nuki tests and avoid dns lookups (#166506)

This commit is contained in:
Simone Chemelli
2026-03-26 15:12:17 +01:00
committed by GitHub
parent 33f11f2263
commit 51a5f5793f
3 changed files with 18 additions and 0 deletions

View File

@@ -27,3 +27,9 @@ async def test_binary_sensors(
entry = await init_integration(hass, mock_nuki_requests)
await snapshot_platform(hass, entity_registry, snapshot, entry.entry_id)
# Unload the config entry after taking a snapshot is required because the integration may cache
# DNS results or keep references to the original gethostbyname, so unloading ensures the patch
# is effective for subsequent tests and avoids DNS lookups
await hass.config_entries.async_unload(entry.entry_id)
await hass.async_block_till_done()

View File

@@ -25,3 +25,9 @@ async def test_locks(
entry = await init_integration(hass, mock_nuki_requests)
await snapshot_platform(hass, entity_registry, snapshot, entry.entry_id)
# Unload the config entry after taking a snapshot is required because the integration may cache
# DNS results or keep references to the original gethostbyname, so unloading ensures the patch
# is effective for subsequent tests and avoids DNS lookups
await hass.config_entries.async_unload(entry.entry_id)
await hass.async_block_till_done()

View File

@@ -25,3 +25,9 @@ async def test_sensors(
entry = await init_integration(hass, mock_nuki_requests)
await snapshot_platform(hass, entity_registry, snapshot, entry.entry_id)
# Unload the config entry after taking a snapshot is required because the integration may cache
# DNS results or keep references to the original gethostbyname, so unloading ensures the patch
# is effective for subsequent tests and avoids DNS lookups
await hass.config_entries.async_unload(entry.entry_id)
await hass.async_block_till_done()