From a40ed2dbb866ec55029c20f23cee3de5c8f89efe Mon Sep 17 00:00:00 2001 From: Rod Boev Date: Thu, 18 Jun 2026 20:44:10 -0400 Subject: [PATCH] fix(test): clear profile cache between tests to prevent cross-test leakage (#2698) --- tests/test_issue2698_isolated_hermes_home.py | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/tests/test_issue2698_isolated_hermes_home.py b/tests/test_issue2698_isolated_hermes_home.py index b1448a06..2d62c197 100644 --- a/tests/test_issue2698_isolated_hermes_home.py +++ b/tests/test_issue2698_isolated_hermes_home.py @@ -13,6 +13,7 @@ from unittest import mock import pytest +import api.profiles as _profiles_mod from api.profiles import ( _is_isolated_profile_mode, list_profiles_api, @@ -21,6 +22,14 @@ from api.profiles import ( ) +@pytest.fixture(autouse=True) +def _clear_profile_cache(): + """Clear the profile list cache before and after each test to prevent cross-test leakage.""" + _profiles_mod._LIST_PROFILES_CACHE = None + yield + _profiles_mod._LIST_PROFILES_CACHE = None + + @pytest.fixture def temp_hermes_home(): """Create a temporary .hermes directory structure for testing."""