test(sandbox): skip host-identity tests on non-Linux platforms

Address review feedback: os.getuid/os.getgid do not exist on Windows and
_host_identity_env() short-circuits off Linux, so the new tests can only
run there.

Refs #1514
This commit is contained in:
J0kkeR 2026-10-13 00:20:32 +08:00
parent 07be5a1b00
commit 1cd95a4f93

View file

@ -1,8 +1,15 @@
import os
import sys
from types import SimpleNamespace
import pytest
from strix.runtime import session_manager
pytestmark = pytest.mark.skipif(
sys.platform != "linux", reason="sandbox uid mapping is Linux-only"
)
def _as(monkeypatch, uid: int, gid: int) -> None:
monkeypatch.setattr(os, "getuid", lambda: uid)