From 26f610e77a8e2e27136cd339fee23ed1c6545647 Mon Sep 17 00:00:00 2001 From: teknium1 <127238744+teknium1@users.noreply.github.com> Date: Sat, 12 Sep 2026 07:08:10 -0700 Subject: [PATCH] test(constants): gate the two symlink tests with require_symlinks, not pytest.skip The two get_hermes_dir symlink tests wrapped symlink_to() in a try/except -> pytest.skip(). tests/conftest.py already has the require_symlinks marker for exactly this (probes symlink support once, skips at setup); using it keeps the test bodies straight-line and the skip reason uniform with the sibling tests in this file. --- tests/test_hermes_constants.py | 12 ++++-------- 1 file changed, 4 insertions(+), 8 deletions(-) diff --git a/tests/test_hermes_constants.py b/tests/test_hermes_constants.py index 093bc9ad60..bc0f21b7ec 100644 --- a/tests/test_hermes_constants.py +++ b/tests/test_hermes_constants.py @@ -749,6 +749,7 @@ class TestGetHermesDir: + @pytest.mark.require_symlinks def test_dangling_legacy_symlink_returns_new(self, tmp_path, monkeypatch): """A dangling legacy symlink must NOT shadow populated new-layout data. @@ -760,16 +761,14 @@ class TestGetHermesDir: """ self._set_home(tmp_path, monkeypatch) legacy = tmp_path / "pairing" - try: - legacy.symlink_to(tmp_path / "does-not-exist") - except (OSError, NotImplementedError) as exc: - pytest.skip(f"Symlink not supported on this platform/permission: {exc}") + legacy.symlink_to(tmp_path / "does-not-exist") new = tmp_path / "platforms" / "pairing" new.mkdir(parents=True) (new / "discord-approved.json").write_text("[]") result = get_hermes_dir("platforms/pairing", "pairing") assert result == new + @pytest.mark.require_symlinks def test_symlink_to_populated_dir_returns_legacy(self, tmp_path, monkeypatch): """A legacy symlink pointing at a populated directory is honoured.""" self._set_home(tmp_path, monkeypatch) @@ -777,10 +776,7 @@ class TestGetHermesDir: real.mkdir() (real / "cached.png").write_bytes(b"x") legacy = tmp_path / "image_cache" - try: - legacy.symlink_to(real) - except (OSError, NotImplementedError) as exc: - pytest.skip(f"Symlink not supported on this platform/permission: {exc}") + legacy.symlink_to(real) result = get_hermes_dir("cache/images", "image_cache") assert result == legacy