mirror of
https://github.com/home-assistant/core.git
synced 2025-04-23 00:37:53 +00:00
Only mock config_entries.HANDLERS for the current test in mock_config_flow (#107357)
This commit is contained in:
parent
65985c4e0b
commit
d6aaaf1f1a
@ -1316,12 +1316,8 @@ async def get_system_health_info(hass: HomeAssistant, domain: str) -> dict[str,
|
||||
@contextmanager
|
||||
def mock_config_flow(domain: str, config_flow: type[ConfigFlow]) -> None:
|
||||
"""Mock a config flow handler."""
|
||||
handler = config_entries.HANDLERS.get(domain)
|
||||
config_entries.HANDLERS[domain] = config_flow
|
||||
_LOGGER.info("Adding mock config flow: %s", domain)
|
||||
yield
|
||||
if handler:
|
||||
config_entries.HANDLERS[domain] = handler
|
||||
with patch.dict(config_entries.HANDLERS, {domain: config_flow}):
|
||||
yield
|
||||
|
||||
|
||||
def mock_integration(
|
||||
|
Loading…
x
Reference in New Issue
Block a user