mirror of
https://github.com/home-assistant/core.git
synced 2025-07-17 18:27:09 +00:00
Don't start test thread as daemon and wait until patching is done (#5494)
This commit is contained in:
parent
9442131373
commit
8217a42960
@ -45,7 +45,6 @@ def get_test_home_assistant():
|
|||||||
|
|
||||||
hass = loop.run_until_complete(async_test_home_assistant(loop))
|
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()
|
stop_event = threading.Event()
|
||||||
|
|
||||||
def run_loop():
|
def run_loop():
|
||||||
@ -56,8 +55,6 @@ def get_test_home_assistant():
|
|||||||
loop.close()
|
loop.close()
|
||||||
stop_event.set()
|
stop_event.set()
|
||||||
|
|
||||||
threading.Thread(name="LoopThread", target=run_loop, daemon=True).start()
|
|
||||||
|
|
||||||
orig_start = hass.start
|
orig_start = hass.start
|
||||||
orig_stop = hass.stop
|
orig_stop = hass.stop
|
||||||
|
|
||||||
@ -76,6 +73,8 @@ def get_test_home_assistant():
|
|||||||
hass.start = start_hass
|
hass.start = start_hass
|
||||||
hass.stop = stop_hass
|
hass.stop = stop_hass
|
||||||
|
|
||||||
|
threading.Thread(name="LoopThread", target=run_loop, daemon=False).start()
|
||||||
|
|
||||||
return hass
|
return hass
|
||||||
|
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user