Temporarily set apprise log level to debug in tests (#121029)

Co-authored-by: Franck Nijhof <git@frenck.dev>
This commit is contained in:
Jan-Philipp Benecke
2024-07-02 22:13:19 +02:00
committed by GitHub
parent 9749cf113a
commit 7d31d553d0

View File

@@ -1,14 +1,27 @@
"""The tests for the apprise notification platform.""" """The tests for the apprise notification platform."""
import logging
from pathlib import Path from pathlib import Path
from unittest.mock import MagicMock, patch from unittest.mock import MagicMock, patch
import pytest
from homeassistant.core import HomeAssistant from homeassistant.core import HomeAssistant
from homeassistant.setup import async_setup_component from homeassistant.setup import async_setup_component
BASE_COMPONENT = "notify" BASE_COMPONENT = "notify"
@pytest.fixture(autouse=True)
def reset_log_level():
"""Set and reset log level after each test case."""
logger = logging.getLogger("apprise")
orig_level = logger.level
logger.setLevel(logging.DEBUG)
yield
logger.setLevel(orig_level)
async def test_apprise_config_load_fail01(hass: HomeAssistant) -> None: async def test_apprise_config_load_fail01(hass: HomeAssistant) -> None:
"""Test apprise configuration failures 1.""" """Test apprise configuration failures 1."""