Fix tests for Python 3.8 (#34672)
This commit is contained in:
1 parent
d53cb951e7
commit
0d700f6a63
40 files changed
+248
-285
No files matched your search
@@ -1,9 +1,9 @@
|
||||
"""The tests for the Cast Media player platform."""
|
||||
# pylint: disable=protected-access
|
||||
from typing import Optional
|
||||
from unittest.mock import MagicMock, Mock, patch
|
||||
from uuid import UUID
|
||||
|
||||
from asynctest import MagicMock, Mock, patch
|
||||
import attr
|
||||
import pytest
|
||||
|
||||
@@ -14,7 +14,7 @@ from homeassistant.exceptions import PlatformNotReady
|
||||
from homeassistant.helpers.typing import HomeAssistantType
|
||||
from homeassistant.setup import async_setup_component
|
||||
|
||||
from tests.common import MockConfigEntry, mock_coro
|
||||
from tests.common import MockConfigEntry
|
||||
|
||||
|
||||
@pytest.fixture(autouse=True)
|
||||
@@ -468,7 +468,6 @@ async def test_entry_setup_no_config(hass: HomeAssistantType):
|
||||
|
||||
with patch(
|
||||
"homeassistant.components.cast.media_player._async_setup_platform",
|
||||
return_value=mock_coro(),
|
||||
) as mock_setup:
|
||||
await cast.async_setup_entry(hass, MockConfigEntry(), None)
|
||||
|
||||
@@ -484,7 +483,6 @@ async def test_entry_setup_single_config(hass: HomeAssistantType):
|
||||
|
||||
with patch(
|
||||
"homeassistant.components.cast.media_player._async_setup_platform",
|
||||
return_value=mock_coro(),
|
||||
) as mock_setup:
|
||||
await cast.async_setup_entry(hass, MockConfigEntry(), None)
|
||||
|
||||
@@ -500,7 +498,6 @@ async def test_entry_setup_list_config(hass: HomeAssistantType):
|
||||
|
||||
with patch(
|
||||
"homeassistant.components.cast.media_player._async_setup_platform",
|
||||
return_value=mock_coro(),
|
||||
) as mock_setup:
|
||||
await cast.async_setup_entry(hass, MockConfigEntry(), None)
|
||||
|
||||
@@ -517,7 +514,7 @@ async def test_entry_setup_platform_not_ready(hass: HomeAssistantType):
|
||||
|
||||
with patch(
|
||||
"homeassistant.components.cast.media_player._async_setup_platform",
|
||||
return_value=mock_coro(exception=Exception),
|
||||
side_effect=Exception,
|
||||
) as mock_setup:
|
||||
with pytest.raises(PlatformNotReady):
|
||||
await cast.async_setup_entry(hass, MockConfigEntry(), None)
|
||||
|
||||
Reference in new issue
Block a user