Use builtin TimeoutError [e-i] (#109679)

This commit is contained in:
Marc Mueller 2024-02-05 12:00:37 +01:00 committed by GitHub
parent c82933175d
commit 7a89e58873
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
69 changed files with 88 additions and 133 deletions

View file

@ -1,5 +1,4 @@
"""The tests for the Foobot sensor platform."""
import asyncio
from http import HTTPStatus
import re
from unittest.mock import MagicMock
@ -65,9 +64,7 @@ async def test_setup_timeout_error(
"""Expected failures caused by a timeout in API response."""
fake_async_add_entities = MagicMock()
aioclient_mock.get(
re.compile("api.foobot.io/v2/owner/.*"), exc=asyncio.TimeoutError()
)
aioclient_mock.get(re.compile("api.foobot.io/v2/owner/.*"), exc=TimeoutError())
with pytest.raises(PlatformNotReady):
await foobot.async_setup_platform(hass, VALID_CONFIG, fake_async_add_entities)