Cleanup coroutine threadsafe (#27080)
* Cleanup coroutine threadsafe * fix lint * Fix typing * Fix tests * Fix black
This commit is contained in:
parent
f4a1f2809b
commit
c1851a2d94
23 changed files with 196 additions and 232 deletions
|
@ -1,5 +1,6 @@
|
|||
"""The tests for Core components."""
|
||||
# pylint: disable=protected-access
|
||||
import asyncio
|
||||
import unittest
|
||||
from unittest.mock import patch, Mock
|
||||
|
||||
|
@ -27,7 +28,6 @@ from homeassistant.components.homeassistant import (
|
|||
import homeassistant.helpers.intent as intent
|
||||
from homeassistant.exceptions import HomeAssistantError
|
||||
from homeassistant.helpers import entity
|
||||
from homeassistant.util.async_ import run_coroutine_threadsafe
|
||||
|
||||
from tests.common import (
|
||||
get_test_home_assistant,
|
||||
|
@ -111,7 +111,7 @@ class TestComponentsCore(unittest.TestCase):
|
|||
def setUp(self):
|
||||
"""Set up things to be run when tests are started."""
|
||||
self.hass = get_test_home_assistant()
|
||||
assert run_coroutine_threadsafe(
|
||||
assert asyncio.run_coroutine_threadsafe(
|
||||
async_setup_component(self.hass, "homeassistant", {}), self.hass.loop
|
||||
).result()
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue