Skip to content

Commit

Permalink
fix mocking
Browse files Browse the repository at this point in the history
  • Loading branch information
bdraco committed Oct 3, 2023
1 parent b5e7af4 commit 38095e9
Showing 1 changed file with 6 additions and 2 deletions.
8 changes: 6 additions & 2 deletions tests/conftest.py
Original file line number Diff line number Diff line change
Expand Up @@ -40,12 +40,16 @@ def driver(async_zeroconf):
"pyhap.accessory_driver.HAPServer.async_start", new_callable=AsyncMock
), patch(
"pyhap.accessory_driver.AccessoryDriver.persist"
), patch(
"pyhap.util.get_local_address", return_value="127.0.0.1"
):
yield AccessoryDriver(loop=loop)


@pytest.fixture(autouse=True)
def mock_local_address():
with patch("pyhap.util.get_local_address", return_value="127.0.0.1"):
yield


class MockDriver:
def __init__(self):
self.loader = Loader()
Expand Down

0 comments on commit 38095e9

Please sign in to comment.