"""pytest 全局配置:把项目根目录加入 sys.path,便于测试直接 import douyin.* / gui.*。 不做 fixture 全局共享,单文件测试自包含;通用 fixture 写到对应 test_*.py 里。 """ from __future__ import annotations import os import sys # 项目根 = tests/ 的父目录 _PROJECT_ROOT = os.path.dirname(os.path.dirname(os.path.abspath(__file__))) if _PROJECT_ROOT not in sys.path: sys.path.insert(0, _PROJECT_ROOT)