mirror of
https://github.com/home-assistant/core.git
synced 2025-07-19 11:17:21 +00:00
Fix coroutine never awaited warning in test (#20892)
This commit is contained in:
parent
987b5cd905
commit
8137b0bb9e
@ -58,9 +58,9 @@ def test_async_add_job_schedule_partial_callback():
|
|||||||
assert len(hass.add_job.mock_calls) == 0
|
assert len(hass.add_job.mock_calls) == 0
|
||||||
|
|
||||||
|
|
||||||
def test_async_add_job_schedule_coroutinefunction():
|
def test_async_add_job_schedule_coroutinefunction(loop):
|
||||||
"""Test that we schedule coroutines and add jobs to the job pool."""
|
"""Test that we schedule coroutines and add jobs to the job pool."""
|
||||||
hass = MagicMock()
|
hass = MagicMock(loop=MagicMock(wraps=loop))
|
||||||
|
|
||||||
async def job():
|
async def job():
|
||||||
pass
|
pass
|
||||||
@ -71,9 +71,9 @@ def test_async_add_job_schedule_coroutinefunction():
|
|||||||
assert len(hass.add_job.mock_calls) == 0
|
assert len(hass.add_job.mock_calls) == 0
|
||||||
|
|
||||||
|
|
||||||
def test_async_add_job_schedule_partial_coroutinefunction():
|
def test_async_add_job_schedule_partial_coroutinefunction(loop):
|
||||||
"""Test that we schedule partial coros and add jobs to the job pool."""
|
"""Test that we schedule partial coros and add jobs to the job pool."""
|
||||||
hass = MagicMock()
|
hass = MagicMock(loop=MagicMock(wraps=loop))
|
||||||
|
|
||||||
async def job():
|
async def job():
|
||||||
pass
|
pass
|
||||||
@ -98,9 +98,9 @@ def test_async_add_job_add_threaded_job_to_pool():
|
|||||||
assert len(hass.loop.run_in_executor.mock_calls) == 1
|
assert len(hass.loop.run_in_executor.mock_calls) == 1
|
||||||
|
|
||||||
|
|
||||||
def test_async_create_task_schedule_coroutine():
|
def test_async_create_task_schedule_coroutine(loop):
|
||||||
"""Test that we schedule coroutines and add jobs to the job pool."""
|
"""Test that we schedule coroutines and add jobs to the job pool."""
|
||||||
hass = MagicMock()
|
hass = MagicMock(loop=MagicMock(wraps=loop))
|
||||||
|
|
||||||
async def job():
|
async def job():
|
||||||
pass
|
pass
|
||||||
|
Loading…
x
Reference in New Issue
Block a user