From a29afc3731fb48a875144f06e6054a604985cf60 Mon Sep 17 00:00:00 2001 From: Franck Nijhof Date: Mon, 14 Mar 2022 11:41:56 +0100 Subject: [PATCH] Clean up Whois tests use entity_registry_enabled_by_default fixture (#68113) --- tests/components/whois/conftest.py | 10 ---------- tests/components/whois/test_sensor.py | 6 +++--- 2 files changed, 3 insertions(+), 13 deletions(-) diff --git a/tests/components/whois/conftest.py b/tests/components/whois/conftest.py index ef14750356e..056f6058bd2 100644 --- a/tests/components/whois/conftest.py +++ b/tests/components/whois/conftest.py @@ -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 diff --git a/tests/components/whois/test_sensor.py b/tests/components/whois/test_sensor.py index e824522ed09..89b84dc5849 100644 --- a/tests/components/whois/test_sensor.py +++ b/tests/components/whois/test_sensor.py @@ -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: