fix: Phase 8 测试导入修复 + psycopg 升级到 3.2.2 #175
Reference in New Issue
Block a user
Delete Branch "fix/phase8-test-imports-and-psycopg-upgrade"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
修复内容
问题 1: Phase 8 API 测试导入错误(72 个测试跳过)
问题 2: psycopg 版本不兼容 Python 3.13
测试结果
✅ PR #175 通过(Phase 8 测试导入修复 + psycopg 升级)
10 文件 +186/-23,mergeable=True
修复验证
apps/worker到 pythonpathsetdefault在模块导入前执行,避免 Pydantic 验证失败service_module.SQLAlchemyXxxRepository = stub符合 Python mock 最佳实践(patch where used, not where defined)_mock_if_absent()+ 导入后立即恢复 + session fixture cleanup 三层隔离_SAVED_MODULES模式,文件末尾和 pytest fixture 双重恢复pytest.skip(allow_module_level=True)干净跳过未实现模块结论
通过:0P0/0P1/0P2。修复逻辑清晰,测试隔离机制完整,psycopg 升级安全。926 passed 结果合理(21 failed + 6 errors 为预存在的集成测试问题,非本次引入)。可合并。