mirror of
https://github.com/home-assistant/core.git
synced 2025-07-31 19:25:12 +02:00
Always mock SubscriptionRegistry & DiscoveryResponder for wemo tests (#53967)
* Always mock SubscriptionRegistry & DiscoveryResponder for wemo tests * Use autospec=True for patch
This commit is contained in:
@@ -22,8 +22,8 @@ def pywemo_model_fixture():
|
||||
return "LightSwitch"
|
||||
|
||||
|
||||
@pytest.fixture(name="pywemo_registry")
|
||||
def pywemo_registry_fixture():
|
||||
@pytest.fixture(name="pywemo_registry", autouse=True)
|
||||
async def async_pywemo_registry_fixture():
|
||||
"""Fixture for SubscriptionRegistry instances."""
|
||||
registry = create_autospec(pywemo.SubscriptionRegistry, instance=True)
|
||||
|
||||
@@ -40,6 +40,13 @@ def pywemo_registry_fixture():
|
||||
yield registry
|
||||
|
||||
|
||||
@pytest.fixture(name="pywemo_discovery_responder", autouse=True)
|
||||
def pywemo_discovery_responder_fixture():
|
||||
"""Fixture for the DiscoveryResponder instance."""
|
||||
with patch("pywemo.ssdp.DiscoveryResponder", autospec=True):
|
||||
yield
|
||||
|
||||
|
||||
@pytest.fixture(name="pywemo_device")
|
||||
def pywemo_device_fixture(pywemo_registry, pywemo_model):
|
||||
"""Fixture for WeMoDevice instances."""
|
||||
|
Reference in New Issue
Block a user