conftest.py 260 B

123456789
  1. """pytest 公共夹具:把模拟器根目录加入 sys.path。"""
  2. from __future__ import annotations
  3. import sys
  4. from pathlib import Path
  5. SIM_ROOT = Path(__file__).resolve().parents[1]
  6. if str(SIM_ROOT) not in sys.path:
  7. sys.path.insert(0, str(SIM_ROOT))