Migrate collection of component tests from coroutine to async/await (#30504)
This commit is contained in:
1 parent
f400b77837
commit
e642d95d0f
7 files changed
+45
-69
No files matched your search
@@ -1,6 +1,4 @@
|
||||
"""The tests for the Prometheus exporter."""
|
||||
import asyncio
|
||||
|
||||
import pytest
|
||||
|
||||
from homeassistant import setup
|
||||
@@ -51,14 +49,13 @@ async def prometheus_client(loop, hass, hass_client):
|
||||
return await hass_client()
|
||||
|
||||
|
||||
@asyncio.coroutine
|
||||
def test_view(prometheus_client): # pylint: disable=redefined-outer-name
|
||||
async def test_view(prometheus_client): # pylint: disable=redefined-outer-name
|
||||
"""Test prometheus metrics view."""
|
||||
resp = yield from prometheus_client.get(prometheus.API_ENDPOINT)
|
||||
resp = await prometheus_client.get(prometheus.API_ENDPOINT)
|
||||
|
||||
assert resp.status == 200
|
||||
assert resp.headers["content-type"] == "text/plain"
|
||||
body = yield from resp.text()
|
||||
body = await resp.text()
|
||||
body = body.split("\n")
|
||||
|
||||
assert len(body) > 3
|
||||
|
||||
Reference in new issue
Block a user