fix(tests): isolate HERMES_HOME in tests and adjust log directory for debug session

Added a fixture to redirect HERMES_HOME to a temporary directory during tests, preventing writes to the user's home directory. Updated the test for DebugSession to create a dedicated log directory for saving logs, ensuring test isolation and accuracy in assertions.
This commit is contained in:
teknium1
2026-03-02 04:34:21 -08:00
parent 56b53bff6e
commit ca5525bcd7
2 changed files with 16 additions and 2 deletions

View File

@@ -26,9 +26,11 @@ class TestDebugSessionDisabled:
def test_save_noop(self, tmp_path):
ds = DebugSession("test_tool", env_var="FAKE_DEBUG_VAR_XYZ")
ds.log_dir = tmp_path
log_dir = tmp_path / "debug_logs"
log_dir.mkdir()
ds.log_dir = log_dir
ds.save()
assert list(tmp_path.iterdir()) == []
assert list(log_dir.iterdir()) == []
def test_get_session_info_disabled(self):
ds = DebugSession("test_tool", env_var="FAKE_DEBUG_VAR_XYZ")