diff --git a/tests/scripts/test_auth.py b/tests/scripts/test_auth.py index 82a8a408c53ea..3d9f26d120478 100644 --- a/tests/scripts/test_auth.py +++ b/tests/scripts/test_auth.py @@ -1,4 +1,5 @@ """Test the auth script to manage local users.""" +import logging from typing import Any from unittest.mock import Mock, patch @@ -11,6 +12,15 @@ from tests.common import register_auth_provider +@pytest.fixture(autouse=True) +def reset_log_level(): + """Reset log level after each test case.""" + logger = logging.getLogger("homeassistant.core") + orig_level = logger.level + yield + logger.setLevel(orig_level) + + @pytest.fixture def provider(hass): """Home Assistant auth provider.""" diff --git a/tests/scripts/test_check_config.py b/tests/scripts/test_check_config.py index 425ad561f509e..9e2f6708c9901 100644 --- a/tests/scripts/test_check_config.py +++ b/tests/scripts/test_check_config.py @@ -1,4 +1,5 @@ """Test check_config script.""" +import logging from unittest.mock import patch import pytest @@ -22,6 +23,15 @@ BAD_CORE_CONFIG = "homeassistant:\n unit_system: bad\n\n\n" +@pytest.fixture(autouse=True) +def reset_log_level(): + """Reset log level after each test case.""" + logger = logging.getLogger("homeassistant.loader") + orig_level = logger.level + yield + logger.setLevel(orig_level) + + @pytest.fixture(autouse=True) async def apply_stop_hass(stop_hass: None) -> None: """Make sure all hass are stopped."""