1
0
mirror of https://github.com/home-assistant/core.git synced 2026-05-28 11:16:40 +01:00

Ignore quirks in Tuya snapshot tests

This commit is contained in:
epenet
2026-05-27 08:40:05 +00:00
parent 762f07f450
commit 2a7c40cdeb
19 changed files with 29 additions and 3 deletions
+11
View File
@@ -4,6 +4,7 @@ from collections.abc import Generator
from unittest.mock import MagicMock, patch
import pytest
from tuya_device_handlers import TUYA_QUIRKS_REGISTRY
from tuya_sharing import CustomerDevice, Manager
from homeassistant.components.tuya.const import (
@@ -139,3 +140,13 @@ def notification_helper(
) -> TuyaNotificationHelper:
"""Fixture for Tuya NotificationHelper."""
return TuyaNotificationHelper(hass, mock_manager)
@pytest.fixture
def no_quirk() -> Generator[None]:
"""Fixture to bypass all quirk registration."""
with (
patch.dict(TUYA_QUIRKS_REGISTRY._quirks, clear=True),
patch("homeassistant.components.tuya.coordinator.register_tuya_quirks"),
):
yield
@@ -33,6 +33,7 @@ def platform_autouse():
yield
@pytest.mark.usefixtures("no_quirk")
async def test_platform_setup_and_discovery(
hass: HomeAssistant,
mock_manager: Manager,
+1 -1
View File
@@ -24,7 +24,7 @@ def platform_autouse():
yield
@pytest.mark.usefixtures("entity_registry_enabled_by_default")
@pytest.mark.usefixtures("entity_registry_enabled_by_default", "no_quirk")
async def test_platform_setup_and_discovery(
hass: HomeAssistant,
mock_manager: Manager,
+1 -1
View File
@@ -23,7 +23,7 @@ def platform_autouse():
yield
@pytest.mark.usefixtures("entity_registry_enabled_by_default")
@pytest.mark.usefixtures("entity_registry_enabled_by_default", "no_quirk")
async def test_platform_setup_and_discovery(
hass: HomeAssistant,
mock_manager: Manager,
+1
View File
@@ -35,6 +35,7 @@ def platform_autouse():
yield
@pytest.mark.usefixtures("no_quirk")
async def test_platform_setup_and_discovery(
hass: HomeAssistant,
mock_manager: Manager,
+1
View File
@@ -53,6 +53,7 @@ def platform_autouse():
yield
@pytest.mark.usefixtures("no_quirk")
async def test_platform_setup_and_discovery(
hass: HomeAssistant,
mock_manager: Manager,
+1
View File
@@ -41,6 +41,7 @@ def platform_autouse():
yield
@pytest.mark.usefixtures("no_quirk")
async def test_platform_setup_and_discovery(
hass: HomeAssistant,
mock_manager: Manager,
+1
View File
@@ -25,6 +25,7 @@ def platform_autouse():
@pytest.mark.freeze_time("2023-11-01 13:14:15+01:00")
@pytest.mark.usefixtures("no_quirk")
async def test_platform_setup_and_discovery(
hass: HomeAssistant,
mock_manager: Manager,
+1
View File
@@ -31,6 +31,7 @@ def platform_autouse():
yield
@pytest.mark.usefixtures("no_quirk")
async def test_platform_setup_and_discovery(
hass: HomeAssistant,
mock_manager: Manager,
+1
View File
@@ -31,6 +31,7 @@ def platform_autouse():
yield
@pytest.mark.usefixtures("no_quirk")
async def test_platform_setup_and_discovery(
hass: HomeAssistant,
mock_manager: Manager,
+1
View File
@@ -108,6 +108,7 @@ async def test_registry_cleanup_multiple_entries(
assert entity_registry.async_get(second_entity_id)
@pytest.mark.usefixtures("no_quirk")
async def test_device_registry(
hass: HomeAssistant,
mock_manager: Manager,
+1
View File
@@ -32,6 +32,7 @@ def platform_autouse():
yield
@pytest.mark.usefixtures("no_quirk")
async def test_platform_setup_and_discovery(
hass: HomeAssistant,
mock_manager: Manager,
+1
View File
@@ -35,6 +35,7 @@ def platform_autouse():
yield
@pytest.mark.usefixtures("no_quirk")
async def test_platform_setup_and_discovery(
hass: HomeAssistant,
mock_manager: Manager,
+1
View File
@@ -30,6 +30,7 @@ def platform_autouse():
yield
@pytest.mark.usefixtures("no_quirk")
async def test_platform_setup_and_discovery(
hass: HomeAssistant,
mock_manager: Manager,
+1 -1
View File
@@ -31,7 +31,7 @@ def platform_autouse():
yield
@pytest.mark.usefixtures("entity_registry_enabled_by_default")
@pytest.mark.usefixtures("entity_registry_enabled_by_default", "no_quirk")
async def test_platform_setup_and_discovery(
hass: HomeAssistant,
mock_manager: Manager,
+1
View File
@@ -29,6 +29,7 @@ def platform_autouse():
yield
@pytest.mark.usefixtures("no_quirk")
async def test_platform_setup_and_discovery(
hass: HomeAssistant,
mock_manager: Manager,
+1
View File
@@ -29,6 +29,7 @@ def platform_autouse():
yield
@pytest.mark.usefixtures("no_quirk")
async def test_platform_setup_and_discovery(
hass: HomeAssistant,
mock_manager: Manager,
+1
View File
@@ -33,6 +33,7 @@ def platform_autouse():
yield
@pytest.mark.usefixtures("no_quirk")
async def test_platform_setup_and_discovery(
hass: HomeAssistant,
mock_manager: Manager,
+1
View File
@@ -29,6 +29,7 @@ def platform_autouse():
yield
@pytest.mark.usefixtures("no_quirk")
async def test_platform_setup_and_discovery(
hass: HomeAssistant,
mock_manager: Manager,