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:
@@ -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()
|
||||
|
||||
@@ -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()
|
||||
|
||||
@@ -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()
|
||||
|
||||
Reference in New Issue
Block a user