test: 移除测试里指向仓库外的绝对 sys.path 硬编码(+ 清掉被跟踪的 .pyc) #1
Reference in New Issue
Block a user
No description provided.
Delete Branch "fix/abs-path"
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?
改了什么
tests/test_protocol.py:把sys.path.insert(0, "/home/program/NextAgent/src")改成相对本仓库布局的Path(__file__).resolve().parent.parent / "src",消除对宿主机另一份(已改动的)检出的耦合。.pyc不再被版本控制跟踪。为什么
原写法让测试 import 到仓库外的脏副本,31 个用例里 1 FAIL + 1 ERROR;改用相对路径后 31/31 全绿。
复审通过:改动与判据一致,两条正向判据全绿、两条变异均被咬住。
Pull request closed