Clean up Whois tests use entity_registry_enabled_by_default fixture (#68113)
This commit is contained in:
parent
fb703ddc5d
commit
a29afc3731
2 changed files with 3 additions and 13 deletions
|
@ -124,13 +124,3 @@ async def init_integration_missing_some_attrs(
|
|||
await hass.async_block_till_done()
|
||||
|
||||
return mock_config_entry
|
||||
|
||||
|
||||
@pytest.fixture
|
||||
def enable_all_entities() -> Generator[AsyncMock, None, None]:
|
||||
"""Test fixture that ensures all entities are enabled in the registry."""
|
||||
with patch(
|
||||
"homeassistant.helpers.entity.Entity.entity_registry_enabled_default",
|
||||
return_value=True,
|
||||
) as mock_entity_registry_enabled_by_default:
|
||||
yield mock_entity_registry_enabled_by_default
|
||||
|
|
|
@ -22,7 +22,7 @@ from tests.common import MockConfigEntry, async_fire_time_changed
|
|||
@pytest.mark.freeze_time("2022-01-01 12:00:00", tz_offset=0)
|
||||
async def test_whois_sensors(
|
||||
hass: HomeAssistant,
|
||||
enable_all_entities: AsyncMock,
|
||||
entity_registry_enabled_by_default: AsyncMock,
|
||||
init_integration: MockConfigEntry,
|
||||
) -> None:
|
||||
"""Test the Whois sensors."""
|
||||
|
@ -146,7 +146,7 @@ async def test_whois_sensors(
|
|||
@pytest.mark.freeze_time("2022-01-01 12:00:00", tz_offset=0)
|
||||
async def test_whois_sensors_missing_some_attrs(
|
||||
hass: HomeAssistant,
|
||||
enable_all_entities: AsyncMock,
|
||||
entity_registry_enabled_by_default: AsyncMock,
|
||||
init_integration_missing_some_attrs: MockConfigEntry,
|
||||
) -> None:
|
||||
"""Test the Whois sensors with owner and reseller missing."""
|
||||
|
@ -213,7 +213,7 @@ async def test_disabled_by_default_sensors(
|
|||
async def test_no_data(
|
||||
hass: HomeAssistant,
|
||||
mock_whois: MagicMock,
|
||||
enable_all_entities: AsyncMock,
|
||||
entity_registry_enabled_by_default: AsyncMock,
|
||||
init_integration: MockConfigEntry,
|
||||
entity_id: str,
|
||||
) -> None:
|
||||
|
|
Loading…
Add table
Reference in a new issue