diff --git a/tests/hermes_cli/test_tui_resume_flow.py b/tests/hermes_cli/test_tui_resume_flow.py index d30b1bb7c838..4bcd3a6119fd 100644 --- a/tests/hermes_cli/test_tui_resume_flow.py +++ b/tests/hermes_cli/test_tui_resume_flow.py @@ -1684,7 +1684,11 @@ def test_launch_tui_worktree_validates_relative_python_against_final_cwd( relative_python = Path(".review-venv") / "bin" / Path(sys.executable).name python_path = worktree / relative_python python_path.parent.mkdir(parents=True) - os.link(sys.executable, python_path) + # copy2, not os.link: tmp_path may sit on a different filesystem than + # the venv (tmpfs /tmp vs disk home) where hard links raise EXDEV. + import shutil + + shutil.copy2(sys.executable, python_path) captured = {} monkeypatch.setenv("HERMES_CWD", str(parent_cwd)) diff --git a/tests/hermes_cli/test_web_server.py b/tests/hermes_cli/test_web_server.py index 24afb5ec9bd3..404a06ae8b84 100644 --- a/tests/hermes_cli/test_web_server.py +++ b/tests/hermes_cli/test_web_server.py @@ -8430,7 +8430,9 @@ class TestPtyWebSocket: relative_python = Path(".review-venv") / "bin" / Path(sys.executable).name python_path = tmp_path / relative_python python_path.parent.mkdir(parents=True) - os.link(sys.executable, python_path) + # copy2, not os.link: tmp_path may sit on a different filesystem than + # the venv (tmpfs /tmp vs disk home) where hard links raise EXDEV. + shutil.copy2(sys.executable, python_path) monkeypatch.setenv("HERMES_CWD", str(tmp_path)) monkeypatch.setenv("HERMES_PYTHON", str(relative_python)) monkeypatch.setattr( @@ -8452,7 +8454,9 @@ class TestPtyWebSocket: bin_dir = tmp_path / "bin" bin_dir.mkdir() executable = bin_dir / command - os.link(sys.executable, executable) + # copy2, not os.link: tmp_path may sit on a different filesystem than + # the venv (tmpfs /tmp vs disk home) where hard links raise EXDEV. + shutil.copy2(sys.executable, executable) env = { "HERMES_CWD": str(tmp_path), "HERMES_PYTHON": command,