The agent that grows with you
Python aiai-agentai-agentsanthropicchatgptclaudeclaude-codecodexhermeshermes-agentllmnous-researchopenai
test(compat): locate POSIX-only pointer targets on Windows instead of importing them
teknium1b0bfbe80b937
diff --git a/tests/hermes_cli/test_compat_manifest_targets.py b/tests/hermes_cli/test_compat_manifest_targets.pyindex 41ca26f557b..d181493f367 100644--- a/tests/hermes_cli/test_compat_manifest_targets.py+++ b/tests/hermes_cli/test_compat_manifest_targets.py@@ -9,15 +9,20 @@ some other facade under the same name, or whose facade stem has a sibling ``<stename, the facade attribute IS the sibling's object."""import importlib+import importlib.utilimport jsonimport pkgutilimport sqlite3+import sysfrom pathlib import Pathimport pytestROOT = Path(__file__).resolve().parent.parent.parentMANIFEST = ROOT / "compat_manifest.json"+# Stdlib modules that do not exist on native Windows; a pointer whose target imports one of them+# (the dashboard PTY bridge: fcntl/termios) cannot be resolved there, only located (#112576).+_POSIX_ONLY_STDLIB = {"fcntl", "termios", "pty", "tty", "grp", "pwd", "resource"}# This file resolves every pointer on purpose; the once-per-name plugin warning is expected here.pytestmark = [@@ -57,6 +62,14 @@ def test_moved_lazy_pointers_resolve_to_the_split_off_siblings_object():continuetry:got = getattr(importlib.import_module(facade), name)+ except ModuleNotFoundError as exc:+ if sys.platform == "win32" and exc.name in _POSIX_ONLY_STDLIB:+ # POSIX-only target: object identity is checked on POSIX hosts; here the+ # declared target module must at least exist in the tree.+ assert importlib.util.find_spec(e["target"]) is not None, (facade, name, e["target"])+ continue+ bad.append((facade, name, f"unresolvable: {exc!r}"))+ continueexcept Exception as exc: # unresolvable pointer is its own failurebad.append((facade, name, f"unresolvable: {exc!r}"))continue