Skip to content

Commit

Permalink
duplicate fixture as workaround
Browse files Browse the repository at this point in the history
  • Loading branch information
David Bonnes committed Sep 10, 2024
1 parent 8492f09 commit a7cdff3
Showing 1 changed file with 8 additions and 0 deletions.
8 changes: 8 additions & 0 deletions tests/tests_new/conftest.py
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,8 @@

import pytest
from homeassistant.core import HomeAssistant
from pytest_homeassistant_custom_component.syrupy import HomeAssistantSnapshotExtension
from syrupy.assertion import SnapshotAssertion

from ..virtual_rf import VirtualRf

Expand All @@ -16,6 +18,12 @@
def auto_enable_custom_integrations(enable_custom_integrations: pytest.fixture): # type: ignore[no-untyped-def]
yield

# NOTE: ? workaround for: https://github.com/MatthewFlamm/pytest-homeassistant-custom-component/issues/198
@pytest.fixture # not loading from pytest_homeassistant_custom_component.plugins
def snapshot(snapshot: SnapshotAssertion) -> SnapshotAssertion:
"""Return snapshot assertion fixture with the Home Assistant extension."""
return snapshot.use_extension(HomeAssistantSnapshotExtension)


@pytest.fixture(autouse=True)
def patches_for_tests(monkeypatch: pytest.MonkeyPatch) -> None:
Expand Down

0 comments on commit a7cdff3

Please sign in to comment.