mirror of
https://github.com/home-assistant/core.git
synced 2025-04-23 00:37:53 +00:00
Load fixture with decorator to avoid variable not accessed error (#118954)
Use fixture decorator
This commit is contained in:
parent
f425420899
commit
6e8d6f5994
@ -12,9 +12,8 @@ from homeassistant.core import HomeAssistant
|
||||
from homeassistant.data_entry_flow import FlowResultType
|
||||
|
||||
|
||||
async def test_form(
|
||||
hass: HomeAssistant, mock_setup_entry: AsyncMock, mock_ista: MagicMock
|
||||
) -> None:
|
||||
@pytest.mark.usefixtures("mock_ista")
|
||||
async def test_form(hass: HomeAssistant, mock_setup_entry: AsyncMock) -> None:
|
||||
"""Test we get the form."""
|
||||
result = await hass.config_entries.flow.async_init(
|
||||
DOMAIN, context={"source": SOURCE_USER}
|
||||
|
@ -19,8 +19,9 @@ from homeassistant.helpers import device_registry as dr
|
||||
from tests.common import MockConfigEntry
|
||||
|
||||
|
||||
@pytest.mark.usefixtures("mock_ista")
|
||||
async def test_entry_setup_unload(
|
||||
hass: HomeAssistant, ista_config_entry: MockConfigEntry, mock_ista: MagicMock
|
||||
hass: HomeAssistant, ista_config_entry: MockConfigEntry
|
||||
) -> None:
|
||||
"""Test integration setup and unload."""
|
||||
|
||||
@ -79,10 +80,10 @@ async def test_config_entry_error(
|
||||
assert ista_config_entry.state is ConfigEntryState.SETUP_ERROR
|
||||
|
||||
|
||||
@pytest.mark.usefixtures("mock_ista")
|
||||
async def test_device_registry(
|
||||
hass: HomeAssistant,
|
||||
ista_config_entry: MockConfigEntry,
|
||||
mock_ista: MagicMock,
|
||||
device_registry: dr.DeviceRegistry,
|
||||
snapshot: SnapshotAssertion,
|
||||
) -> None:
|
||||
|
@ -1,7 +1,5 @@
|
||||
"""Tests for the ista EcoTrend Sensors."""
|
||||
|
||||
from unittest.mock import MagicMock
|
||||
|
||||
import pytest
|
||||
from syrupy.assertion import SnapshotAssertion
|
||||
|
||||
@ -12,11 +10,10 @@ from homeassistant.helpers import entity_registry as er
|
||||
from tests.common import MockConfigEntry, snapshot_platform
|
||||
|
||||
|
||||
@pytest.mark.usefixtures("entity_registry_enabled_by_default")
|
||||
@pytest.mark.usefixtures("mock_ista", "entity_registry_enabled_by_default")
|
||||
async def test_setup(
|
||||
hass: HomeAssistant,
|
||||
ista_config_entry: MockConfigEntry,
|
||||
mock_ista: MagicMock,
|
||||
entity_registry: er.EntityRegistry,
|
||||
snapshot: SnapshotAssertion,
|
||||
) -> None:
|
||||
|
Loading…
x
Reference in New Issue
Block a user