Don't start test thread as daemon and wait until patching is done (#5494)

This commit is contained in:
Adam Mills 2017-01-23 00:03:55 -05:00 committed by Johann Kellerman
parent 9442131373
commit 8217a42960

View file

@ -45,7 +45,6 @@ def get_test_home_assistant():
hass = loop.run_until_complete(async_test_home_assistant(loop))
# FIXME should not be a daemon. Means hass.stop() not called in teardown
stop_event = threading.Event()
def run_loop():
@ -56,8 +55,6 @@ def get_test_home_assistant():
loop.close()
stop_event.set()
threading.Thread(name="LoopThread", target=run_loop, daemon=True).start()
orig_start = hass.start
orig_stop = hass.stop
@ -76,6 +73,8 @@ def get_test_home_assistant():
hass.start = start_hass
hass.stop = stop_hass
threading.Thread(name="LoopThread", target=run_loop, daemon=False).start()
return hass