fix(test): clear profile cache between tests to prevent cross-test leakage (#2698)
This commit is contained in:
1 parent
35eced6f35
commit
a40ed2dbb8
1 file changed
+9
@@ -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."""
|
||||
|
||||
Reference in new issue
Block a user