conftest.py 490 B

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