From c837f185f71c6cd86a81696591183d49fd1aa2f5 Mon Sep 17 00:00:00 2001 From: Franck Nijhof Date: Thu, 2 Jan 2020 00:21:21 +0100 Subject: [PATCH] Migrate camera tests from coroutine to async/await (#30372) --- tests/components/camera/test_init.py | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/tests/components/camera/test_init.py b/tests/components/camera/test_init.py index 89a19d0458a..4bd13c35ad8 100644 --- a/tests/components/camera/test_init.py +++ b/tests/components/camera/test_init.py @@ -147,8 +147,7 @@ class TestGetImage: ).result() -@asyncio.coroutine -def test_snapshot_service(hass, mock_camera): +async def test_snapshot_service(hass, mock_camera): """Test snapshot service.""" mopen = mock_open() @@ -156,7 +155,7 @@ def test_snapshot_service(hass, mock_camera): "homeassistant.components.camera.open", mopen, create=True ), patch.object(hass.config, "is_allowed_path", return_value=True): common.async_snapshot(hass, "/tmp/bla") - yield from hass.async_block_till_done() + await hass.async_block_till_done() mock_write = mopen().write