Clarify ConfigEntryNotReady log (#45425)

Co-authored-by: Martin Hjelmare <marhje52@gmail.com>
Co-authored-by: Charles Garwood <cgarwood@gmail.com>
This commit is contained in:
Simone Chemelli 2021-01-22 18:13:23 +01:00 committed by GitHub
parent 198b875a6f
commit 86cd7911de
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 4 additions and 3 deletions

View File

@ -246,7 +246,8 @@ class ConfigEntry:
wait_time = 2 ** min(tries, 4) * 5
tries += 1
_LOGGER.warning(
"Config entry for %s not ready yet. Retrying in %d seconds",
"Config entry '%s' for %s integration not ready yet. Retrying in %d seconds",
self.title,
self.domain,
wait_time,
)

View File

@ -792,7 +792,7 @@ async def test_update_entry_options_and_trigger_listener(hass, manager):
async def test_setup_raise_not_ready(hass, caplog):
"""Test a setup raising not ready."""
entry = MockConfigEntry(domain="test")
entry = MockConfigEntry(title="test_title", domain="test")
mock_setup_entry = AsyncMock(side_effect=ConfigEntryNotReady)
mock_integration(hass, MockModule("test", async_setup_entry=mock_setup_entry))
@ -802,7 +802,7 @@ async def test_setup_raise_not_ready(hass, caplog):
await entry.async_setup(hass)
assert len(mock_call.mock_calls) == 1
assert "Config entry for test not ready yet" in caplog.text
assert "Config entry 'test_title' for test integration not ready yet" in caplog.text
p_hass, p_wait_time, p_setup = mock_call.mock_calls[0][1]
assert p_hass is hass