Reset log level in script tests (#109881)

This commit is contained in:
Marc Mueller 2024-02-07 17:22:10 +01:00 committed by GitHub
parent b5b09446a1
commit de066c7fc0
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
2 changed files with 20 additions and 0 deletions

View file

@ -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 homeassistant.scripts import auth as script_auth
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."""