test: Add fixture to prevent having disabled loggers

This commit is contained in:
Matthias
2025-03-15 08:30:32 +01:00
parent 415e361c66
commit 39288d2e53
3 changed files with 16 additions and 1 deletions

View File

@@ -549,6 +549,14 @@ def user_dir(mocker, tmp_path) -> Path:
return user_dir
@pytest.fixture()
def keep_log_config_loggers(mocker):
# Mock the _handle_existing_loggers function to prevent it from disabling all loggers.
# This is necessary to keep all loggers active, and avoid random failures if
# this file is ran before the test_rest_client file.
mocker.patch("logging.config._handle_existing_loggers")
@pytest.fixture(autouse=True)
def patch_coingecko(mocker) -> None:
"""