Skip to content

The agent that grows with you

test: posix hand-off protocol tests skip, not error, where fcntl is absent

Teknium8f8e10deeda3
diff --git a/tests/scripts/desktop_update/test_desktop_update_posix_handoff_protocol.py b/tests/scripts/desktop_update/test_desktop_update_posix_handoff_protocol.py
index e8c540ff6fa..f8196ae9093 100644
--- a/tests/scripts/desktop_update/test_desktop_update_posix_handoff_protocol.py
+++ b/tests/scripts/desktop_update/test_desktop_update_posix_handoff_protocol.py
@@ -14,7 +14,6 @@ One or two invariant tests per Round 5 finding:
from __future__ import annotations
-import fcntl # windows-footgun: ok — linux-only module (platforms("linux"))
import os
from pathlib import Path
import re
@@ -25,6 +24,10 @@ import time
import pytest
+# linux-only module (platforms("linux")): skip the module where it is absent instead of
+# failing collection on Windows
+fcntl = pytest.importorskip("fcntl") # windows-footgun: ok
+
from tests.scripts.desktop_update.lineage_rule_cases import ENV_CASES, RULE_CASES
from tests.scripts.desktop_update.lineage_rule_cases import FACTS as LINEAGE_FACTS
from tests.scripts.desktop_update.test_desktop_update_posix_marker import POSIX, _calls, _ct, _install