mirror of
https://github.com/home-assistant/core.git
synced 2025-04-24 01:08:12 +00:00
Fix AsyncMock imports (#129192)
This commit is contained in:
parent
10300cc478
commit
bdfb47e999
@ -1,7 +1,7 @@
|
||||
"""AirGradient tests configuration."""
|
||||
|
||||
from collections.abc import Generator
|
||||
from unittest.mock import patch
|
||||
from unittest.mock import AsyncMock, patch
|
||||
|
||||
from airgradient import Config, Measures
|
||||
import pytest
|
||||
@ -10,7 +10,6 @@ from homeassistant.components.airgradient.const import DOMAIN
|
||||
from homeassistant.const import CONF_HOST
|
||||
|
||||
from tests.common import MockConfigEntry, load_fixture
|
||||
from tests.components.smhi.common import AsyncMock
|
||||
|
||||
|
||||
@pytest.fixture
|
||||
|
@ -1,7 +1,7 @@
|
||||
"""Cambridge Audio tests configuration."""
|
||||
|
||||
from collections.abc import Generator
|
||||
from unittest.mock import Mock, patch
|
||||
from unittest.mock import AsyncMock, Mock, patch
|
||||
|
||||
from aiostreammagic.models import (
|
||||
Display,
|
||||
@ -19,7 +19,6 @@ from homeassistant.components.cambridge_audio.const import DOMAIN
|
||||
from homeassistant.const import CONF_HOST
|
||||
|
||||
from tests.common import MockConfigEntry, load_fixture, load_json_array_fixture
|
||||
from tests.components.smhi.common import AsyncMock
|
||||
|
||||
|
||||
@pytest.fixture
|
||||
|
@ -2,7 +2,7 @@
|
||||
|
||||
from collections.abc import Generator
|
||||
from typing import Any
|
||||
from unittest.mock import MagicMock, patch
|
||||
from unittest.mock import AsyncMock, MagicMock, patch
|
||||
|
||||
from geniushubclient import GeniusDevice, GeniusZone
|
||||
import pytest
|
||||
@ -11,7 +11,6 @@ from homeassistant.components.geniushub.const import DOMAIN
|
||||
from homeassistant.const import CONF_HOST, CONF_PASSWORD, CONF_TOKEN, CONF_USERNAME
|
||||
|
||||
from tests.common import MockConfigEntry, load_json_array_fixture
|
||||
from tests.components.smhi.common import AsyncMock
|
||||
|
||||
|
||||
@pytest.fixture
|
||||
|
@ -1,7 +1,7 @@
|
||||
"""Mastodon tests configuration."""
|
||||
|
||||
from collections.abc import Generator
|
||||
from unittest.mock import patch
|
||||
from unittest.mock import AsyncMock, patch
|
||||
|
||||
import pytest
|
||||
|
||||
@ -9,7 +9,6 @@ from homeassistant.components.mastodon.const import CONF_BASE_URL, DOMAIN
|
||||
from homeassistant.const import CONF_ACCESS_TOKEN, CONF_CLIENT_ID, CONF_CLIENT_SECRET
|
||||
|
||||
from tests.common import MockConfigEntry, load_json_object_fixture
|
||||
from tests.components.smhi.common import AsyncMock
|
||||
|
||||
|
||||
@pytest.fixture
|
||||
|
@ -1,7 +1,7 @@
|
||||
"""Mealie tests configuration."""
|
||||
|
||||
from collections.abc import Generator
|
||||
from unittest.mock import patch
|
||||
from unittest.mock import AsyncMock, patch
|
||||
|
||||
from aiomealie import (
|
||||
About,
|
||||
@ -20,7 +20,6 @@ from homeassistant.components.mealie.const import DOMAIN
|
||||
from homeassistant.const import CONF_API_TOKEN, CONF_HOST
|
||||
|
||||
from tests.common import MockConfigEntry, load_fixture
|
||||
from tests.components.smhi.common import AsyncMock
|
||||
|
||||
SHOPPING_LIST_ID = "list-id-1"
|
||||
SHOPPING_ITEM_NOTE = "Shopping Item 1"
|
||||
|
@ -1,7 +1,7 @@
|
||||
"""NYTGames tests configuration."""
|
||||
|
||||
from collections.abc import Generator
|
||||
from unittest.mock import patch
|
||||
from unittest.mock import AsyncMock, patch
|
||||
|
||||
from nyt_games.models import ConnectionsStats, WordleStats
|
||||
import pytest
|
||||
@ -10,7 +10,6 @@ from homeassistant.components.nyt_games.const import DOMAIN
|
||||
from homeassistant.const import CONF_TOKEN
|
||||
|
||||
from tests.common import MockConfigEntry, load_fixture
|
||||
from tests.components.smhi.common import AsyncMock
|
||||
|
||||
|
||||
@pytest.fixture
|
||||
|
@ -1,7 +1,7 @@
|
||||
"""Smarty tests configuration."""
|
||||
|
||||
from collections.abc import Generator
|
||||
from unittest.mock import patch
|
||||
from unittest.mock import AsyncMock, patch
|
||||
|
||||
import pytest
|
||||
|
||||
@ -9,7 +9,6 @@ from homeassistant.components.smarty import DOMAIN
|
||||
from homeassistant.const import CONF_HOST
|
||||
|
||||
from tests.common import MockConfigEntry
|
||||
from tests.components.smhi.common import AsyncMock
|
||||
|
||||
|
||||
@pytest.fixture
|
||||
|
@ -1,11 +0,0 @@
|
||||
"""Common test utilities."""
|
||||
|
||||
from unittest.mock import Mock
|
||||
|
||||
|
||||
class AsyncMock(Mock):
|
||||
"""Implements Mock async."""
|
||||
|
||||
async def __call__(self, *args, **kwargs):
|
||||
"""Hack for async support for Mock."""
|
||||
return super().__call__(*args, **kwargs)
|
Loading…
x
Reference in New Issue
Block a user