mirror of
https://github.com/home-assistant/core.git
synced 2026-05-08 17:49:37 +01:00
Migrate remaining calls in config modules to async_get_component (#112293)
* Migrate remaining calls in config modules to async_get_component There were a few cases that were still using get_component that could have done blocking I/O in the event loop, although it was unlikely. The caching check in async_get_component has been moved up to avoid creating the future if the module is already in the cache * fix one more
This commit is contained in:
@@ -1188,10 +1188,9 @@ async def test_async_get_component_loads_loop_if_already_in_sys_modules(
|
||||
), patch("homeassistant.loader.importlib.import_module", import_module):
|
||||
module = await integration.async_get_component()
|
||||
|
||||
# Everything is there so we should load in the event loop
|
||||
# since it will all be cached
|
||||
assert "loaded_executor=False" in caplog.text
|
||||
assert "loaded_executor=True" not in caplog.text
|
||||
# Everything is already in the integration cache
|
||||
# so it should not have to call the load
|
||||
assert "loaded_executor" not in caplog.text
|
||||
assert module is module_mock
|
||||
|
||||
|
||||
|
||||
Reference in New Issue
Block a user