From cb91d2f547c04b3251bfc0c2e05d9c500b4af75d Mon Sep 17 00:00:00 2001 From: MatthewFlamm <39341281+MatthewFlamm@users.noreply.github.com> Date: Mon, 31 May 2021 03:33:44 -0400 Subject: [PATCH] Use `enable_custom_integrations` fixture by default (#58) --- requirements_test.txt | 2 +- tests/conftest.py | 7 +++++++ 2 files changed, 8 insertions(+), 1 deletion(-) diff --git a/requirements_test.txt b/requirements_test.txt index 1519e80..ee5e049 100644 --- a/requirements_test.txt +++ b/requirements_test.txt @@ -1 +1 @@ -pytest-homeassistant-custom-component==0.3.0 +pytest-homeassistant-custom-component==0.4.0 diff --git a/tests/conftest.py b/tests/conftest.py index 8fb21db..f7835f6 100644 --- a/tests/conftest.py +++ b/tests/conftest.py @@ -21,6 +21,13 @@ pytest_plugins = "pytest_homeassistant_custom_component" +# This fixture enables loading custom integrations in all tests. +# Remove to enable selective use of this fixture +@pytest.fixture(autouse=True) +def auto_enable_custom_integrations(enable_custom_integrations): + yield + + # This fixture is used to prevent HomeAssistant from attempting to create and dismiss persistent # notifications. These calls would fail without this fixture since the persistent_notification # integration is never loaded during a test.