Track tasks only during shutdown and tests (#4428)
* Track tasks only when needed * Tweak async_block_till_done
This commit is contained in:
1 parent
42c99b0ccb
commit
eacdce9ed9
4 files changed
+42
-48
No files matched your search
+3
-3
@@ -82,6 +82,7 @@ def async_test_home_assistant(loop):
|
||||
loop._thread_ident = threading.get_ident()
|
||||
|
||||
hass = ha.HomeAssistant(loop)
|
||||
hass.async_track_tasks()
|
||||
|
||||
hass.config.location_name = 'test home'
|
||||
hass.config.config_dir = get_test_config_dir()
|
||||
@@ -103,9 +104,8 @@ def async_test_home_assistant(loop):
|
||||
@asyncio.coroutine
|
||||
def mock_async_start():
|
||||
"""Start the mocking."""
|
||||
with patch.object(loop, 'add_signal_handler'),\
|
||||
patch('homeassistant.core._async_create_timer'),\
|
||||
patch.object(hass, '_async_tasks_cleanup', return_value=None):
|
||||
with patch.object(loop, 'add_signal_handler'), \
|
||||
patch('homeassistant.core._async_create_timer'):
|
||||
yield from orig_start()
|
||||
|
||||
hass.async_start = mock_async_start
|
||||
|
||||
Reference in new issue
Block a user