Remove ThreadPool with async executor (#4154)

* Remove ThreadPool with async executor

* Fix zigbee

* update unittest

* fix remote api

* add pending task to remote

* fix lint

* remove unused import

* remove old stuff for lazy tests

* fix bug and add a exception handler to executor

* change executor handling

* change to wait from gather

* fix unittest
This commit is contained in:
Pascal Vizeli 2016-11-05 17:27:55 +01:00 committed by Paulus Schoutsen
parent b67f1fed52
commit ece58ce78f
10 changed files with 37 additions and 346 deletions

View file

@ -40,7 +40,6 @@ def get_test_home_assistant():
loop = asyncio.new_event_loop()
hass = loop.run_until_complete(async_test_home_assistant(loop))
hass.allow_pool = True
# FIXME should not be a daemon. Means hass.stop() not called in teardown
stop_event = threading.Event()
@ -97,8 +96,6 @@ def async_test_home_assistant(loop):
hass.state = ha.CoreState.running
hass.allow_pool = False
# Mock async_start
orig_start = hass.async_start
@ -110,20 +107,6 @@ def async_test_home_assistant(loop):
hass.async_start = mock_async_start
# Mock async_init_pool
orig_init = hass.async_init_pool
@ha.callback
def mock_async_init_pool():
"""Prevent worker pool from being initialized."""
if hass.allow_pool:
with patch('homeassistant.core._async_monitor_worker_pool'):
orig_init()
else:
assert False, 'Thread pool not allowed. Set hass.allow_pool = True'
hass.async_init_pool = mock_async_init_pool
return hass