Clean up Whois tests use entity_registry_enabled_by_default fixture (#68113)

This commit is contained in:
Franck Nijhof 2022-03-14 11:41:56 +01:00 committed by GitHub
parent fb703ddc5d
commit a29afc3731
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
2 changed files with 3 additions and 13 deletions

View file

@ -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

View file

@ -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: