mirror of
https://github.com/NousResearch/hermes-agent.git
synced 2026-06-09 08:21:50 +00:00
fix(test): add platform guard for grp import
Tests in test_gateway_service.py imported grp inline without a
platform guard, causing ImportError on systems where grp is
unavailable (e.g. macOS, WSL without grp module).
Added pytest.importorskip('grp') at module level alongside the
existing pwd guard, and removed three redundant inline import grp
statements.
Fixes #24531
This commit is contained in:
parent
99cee124dc
commit
4a4b9bd2dc
1 changed files with 1 additions and 1 deletions
|
|
@ -8,6 +8,7 @@ from types import SimpleNamespace
|
|||
import pytest
|
||||
|
||||
pwd = pytest.importorskip("pwd")
|
||||
grp = pytest.importorskip("grp")
|
||||
|
||||
import hermes_cli.gateway as gateway_cli
|
||||
from gateway import status
|
||||
|
|
@ -1331,7 +1332,6 @@ class TestSystemServiceIdentityRootHandling:
|
|||
|
||||
def test_explicit_root_is_allowed(self, monkeypatch):
|
||||
"""When root is explicitly passed via --run-as-user root, allow it."""
|
||||
import grp
|
||||
|
||||
root_info = pwd.getpwnam("root")
|
||||
root_group = grp.getgrgid(root_info.pw_gid).gr_name
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue