Skip to content

Commit

Permalink
Merge pull request #267 from PeteRager/pytest-updates
Browse files Browse the repository at this point in the history
Pytest updates
  • Loading branch information
PeteRager committed Oct 3, 2023
2 parents 25ce86f + e2e4bf4 commit 83fae82
Show file tree
Hide file tree
Showing 4 changed files with 273 additions and 287 deletions.
2 changes: 1 addition & 1 deletion .vscode/settings.json
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
{
"python.testing.pytestArgs": ["tests"],
"python.testing.pytestArgs": ["tests", "--asyncio-mode=auto"],
"python.testing.unittestEnabled": false,
"python.testing.pytestEnabled": true,
"cSpell.words": [
Expand Down
8 changes: 8 additions & 0 deletions tests/conftest.py
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,7 @@
)
from lennoxs30api.s30exception import S30Exception

from homeassistant.helpers import device_registry as dr
from homeassistant.exceptions import HomeAssistantError
from homeassistant.components.number import NumberEntity
from homeassistant.components.select import SelectEntity
Expand Down Expand Up @@ -80,6 +81,13 @@ def auto_enable_custom_integrations(enable_custom_integrations):
yield


@pytest.fixture(autouse=True)
def disable_device_registry(hass):
device_registry = dr.async_get(hass)
with patch.object(device_registry, "async_get_or_create"):
yield


@pytest.fixture
def calls(hass):
"""Track calls to a mock service."""
Expand Down
Loading

0 comments on commit 83fae82

Please sign in to comment.