-
Notifications
You must be signed in to change notification settings - Fork 35
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
2 changed files
with
6 additions
and
35 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,39 +1,10 @@ | ||
from typing import Any, Generator | ||
|
||
import pytest | ||
from homeassistant.core import HomeAssistant | ||
from homeassistant.helpers.area_registry import AreaRegistry | ||
from homeassistant.helpers.device_registry import DeviceRegistry | ||
from homeassistant.helpers.entity_registry import EntityRegistry | ||
from pytest_homeassistant_custom_component.common import ( | ||
mock_area_registry, | ||
mock_device_registry, | ||
mock_registry, | ||
) | ||
|
||
|
||
@pytest.fixture(autouse=True) | ||
def auto_enable_custom_integrations(enable_custom_integrations: bool) -> None: | ||
def auto_enable_custom_integrations( | ||
enable_custom_integrations: bool, | ||
) -> Generator[Any, Any, Any]: | ||
yield | ||
|
||
|
||
@pytest.fixture | ||
def enable_custom_integrations(hass: HomeAssistant) -> None: | ||
"""Enable custom integrations defined in the test dir.""" | ||
# hass.data.pop(loader.DATA_CUSTOM_COMPONENTS) | ||
|
||
|
||
@pytest.fixture | ||
def area_reg(hass: HomeAssistant) -> AreaRegistry: | ||
"""Return an empty, loaded, registry.""" | ||
return mock_area_registry(hass) | ||
|
||
|
||
@pytest.fixture | ||
def device_reg(hass: HomeAssistant) -> DeviceRegistry: | ||
"""Return an empty, loaded, registry.""" | ||
return mock_device_registry(hass) | ||
|
||
|
||
@pytest.fixture | ||
def entity_reg(hass: HomeAssistant) -> EntityRegistry: | ||
"""Return an empty, loaded, registry.""" | ||
return mock_registry(hass) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters