"""Pytest hooks shared by unit/structure suites. Rewrite bare OSS CAD ``libexec`` ``sys.executable`` to the LD-safe wrapper so CLI subprocess tests do not exit 127 after TD poison-strip. """ from __future__ import annotations import sys from pathlib import Path _REPO_ROOT = Path(__file__).resolve().parents[1] if str(_REPO_ROOT) not in sys.path: sys.path.insert(0, str(_REPO_ROOT)) from tools.tool_env import ensure_safe_sys_executable # noqa: E402 ensure_safe_sys_executable()