mirror of
https://github.com/home-assistant/core.git
synced 2025-11-09 19:09:32 +00:00
Improve config entry has already been setup error message (#117091)
This commit is contained in:
@@ -3,6 +3,7 @@
|
||||
from collections import OrderedDict
|
||||
from datetime import timedelta
|
||||
import logging
|
||||
import re
|
||||
from unittest.mock import AsyncMock, Mock, patch
|
||||
|
||||
from freezegun import freeze_time
|
||||
@@ -363,7 +364,13 @@ async def test_setup_entry_fails_duplicate(hass: HomeAssistant) -> None:
|
||||
|
||||
assert await component.async_setup_entry(entry)
|
||||
|
||||
with pytest.raises(ValueError):
|
||||
with pytest.raises(
|
||||
ValueError,
|
||||
match=re.escape(
|
||||
f"Config entry Mock Title ({entry.entry_id}) for "
|
||||
"entry_domain.test_domain has already been setup!"
|
||||
),
|
||||
):
|
||||
await component.async_setup_entry(entry)
|
||||
|
||||
|
||||
|
||||
Reference in New Issue
Block a user