diff --git a/tests/conftest.py b/tests/conftest.py index 438b563..eafbe20 100644 --- a/tests/conftest.py +++ b/tests/conftest.py @@ -1,3 +1,5 @@ +import logging + import pytest import responses from elmo.api.client import ElmoClient @@ -15,6 +17,18 @@ pytest_plugins = ["tests.hass.fixtures"] +def pytest_configure(config: pytest.Config) -> None: + """Keeps the default log level to WARNING. + + Home Assistant sets the log level to `DEBUG` if the `--verbose` flag is used. + Considering all the debug logs of this integration and `econnect-python`, this is very + noisy. This is an override for `tests/hass/fixtures.py` as described in this + issue: https://github.com/palazzem/ha-econnect-alarm/issues/134 + """ + if config.getoption("verbose") > 0: + logging.getLogger().setLevel(logging.WARNING) + + @pytest.fixture async def hass(hass): """Create a Home Assistant instance for testing.