Migrate camera tests from coroutine to async/await (#30372)

This commit is contained in:
Franck Nijhof authored and Andrew Sayre committed 2020-01-01 17:21:21 -06:00
1 parent 8814e1eadc
commit c837f185f7
1 file changed
+2 -3
+2 -3
View File
@@ -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