"""Tests for the Entity Registry."""
import asyncio
from unittest.mock import patch

import asynctest
import pytest

from homeassistant.core import valid_entity_id, callback
from homeassistant.helpers import entity_registry

from tests.common import mock_registry, flush_store


YAML__OPEN_PATH = 'homeassistant.util.yaml.loader.open'


@pytest.fixture
def registry(hass):
    """Return an empty, loaded, registry."""
    return mock_registry(hass)


@pytest.fixture
def update_events(hass):
    """Capture update events."""
    events = []

    @callback