fix: remove dead _save_user_data function and stale mock

This commit is contained in:
Greyson Lalonde
2026-03-13 01:40:42 -04:00
parent e303ca4243
commit d36f53312c
2 changed files with 3 additions and 18 deletions

View File

@@ -144,15 +144,6 @@ def _user_data_lock_name() -> str:
return f"file:{os.path.realpath(_user_data_file())}"
def _save_user_data(data: dict[str, Any]) -> None:
try:
p = _user_data_file()
with store_lock(_user_data_lock_name()):
p.write_text(json.dumps(data, indent=2))
except (OSError, PermissionError) as e:
logger.warning(f"Failed to save user data: {e}")
def update_user_data(updates: dict[str, Any]) -> None:
"""Atomically read-modify-write the user data file.

View File

@@ -23,15 +23,9 @@ class TestTraceListenerSetup:
@pytest.fixture(autouse=True)
def mock_user_data_file_io(self):
"""Mock user data file I/O to prevent file system pollution between tests"""
with (
patch(
"crewai.events.listeners.tracing.utils._load_user_data",
return_value={},
),
patch(
"crewai.events.listeners.tracing.utils._save_user_data",
return_value=None,
),
with patch(
"crewai.events.listeners.tracing.utils._load_user_data",
return_value={},
):
yield