test: 新增单测 CI 门禁与规范文档,处理 #5868/#5873 review 反馈 (#5877)

This commit is contained in:
InfinityPacer
2026-06-02 12:57:55 +08:00
committed by GitHub
parent 7c73a57bbc
commit 223854d4c6
8 changed files with 227 additions and 15 deletions
+8 -2
View File
@@ -75,8 +75,14 @@ def setUpModule():
patch.object(MoviePilotServerHelper, "report_recognize_share", new=MagicMock(return_value=None)),
patch.object(MoviePilotServerHelper, "query_recognize_share", new=MagicMock(return_value=None)),
])
for patcher in _PATCHERS:
patcher.start()
try:
for patcher in _PATCHERS:
patcher.start()
except Exception:
# 任一 patcher.start() 失败(如重构致类/方法改名)时回滚已启动的桩并清空,
# 避免半启动状态泄漏到其它测试模块。
tearDownModule()
raise
def tearDownModule():