refactor: 调整模块导入路径,简化引用结构
- 更新 openspec/config.yaml 中 git 任务相关说明 - 将 scripts.core.* 改为 core.*,scripts.readers.* 改为 readers.* - 优化 lyxy_document_reader.py 中 sys.path 设置方式 - 同步更新所有测试文件的导入路径
This commit is contained in:
@@ -1,7 +1,16 @@
|
||||
"""测试配置和共享 fixtures。"""
|
||||
|
||||
import sys
|
||||
from pathlib import Path
|
||||
|
||||
# 将 scripts/ 目录添加到 sys.path(必须在最顶部,在其他导入之前)
|
||||
project_root = Path(__file__).resolve().parent.parent # tests/ 的父目录是项目根目录
|
||||
scripts_dir = project_root / "scripts"
|
||||
if str(scripts_dir) not in sys.path:
|
||||
sys.path.insert(0, str(scripts_dir))
|
||||
|
||||
import pytest
|
||||
from scripts.readers import READERS
|
||||
from readers import READERS
|
||||
|
||||
|
||||
@pytest.fixture
|
||||
|
||||
Reference in New Issue
Block a user