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:
parent
e11ffbcdaf
commit
71b123845c
1 changed files with 9 additions and 2 deletions
|
@ -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."""
|
||||
|
|
Loading…
Add table
Reference in a new issue