diff --git a/hermes_cli/main.py b/hermes_cli/main.py index 7ce7ece58d6..25ea651b2e4 100644 --- a/hermes_cli/main.py +++ b/hermes_cli/main.py @@ -82,7 +82,6 @@ def _exit_after_oneshot(rc: object) -> None: except Exception: pass try: - import logging logging.shutdown() except Exception: pass diff --git a/tests/hermes_cli/test_tui_resume_flow.py b/tests/hermes_cli/test_tui_resume_flow.py index d171ab3d14a..d30b1bb7c83 100644 --- a/tests/hermes_cli/test_tui_resume_flow.py +++ b/tests/hermes_cli/test_tui_resume_flow.py @@ -805,6 +805,7 @@ def test_run_and_exit_oneshot_routes_system_exit_to_hard_exit(monkeypatch, main_ "hermes_cli.oneshot", types.SimpleNamespace(run_oneshot=fake_run_oneshot), ) + monkeypatch.setattr(main_mod, "_cleanup_oneshot_runtime", lambda: None) monkeypatch.setattr(main_mod, "_exit_after_oneshot", lambda rc: exits.append(rc)) main_mod._run_and_exit_oneshot("hello") @@ -844,6 +845,7 @@ def test_run_and_exit_oneshot_prints_system_exit_message( "hermes_cli.oneshot", types.SimpleNamespace(run_oneshot=fake_run_oneshot), ) + monkeypatch.setattr(main_mod, "_cleanup_oneshot_runtime", lambda: None) monkeypatch.setattr(main_mod, "_exit_after_oneshot", lambda rc: exits.append(rc)) main_mod._run_and_exit_oneshot("hello") @@ -986,6 +988,7 @@ def test_run_and_exit_oneshot_routes_keyboard_interrupt_to_130( "hermes_cli.oneshot", types.SimpleNamespace(run_oneshot=fake_run_oneshot), ) + monkeypatch.setattr(main_mod, "_cleanup_oneshot_runtime", lambda: None) monkeypatch.setattr(main_mod, "_exit_after_oneshot", lambda rc: exits.append(rc)) main_mod._run_and_exit_oneshot("hello")