mirror of
https://github.com/jxxghp/MoviePilot.git
synced 2026-09-04 23:17:20 +08:00
test: 隔离单测中的站点原生资源 (#6452)
* test: isolate native site resources * refactor(test): retain sites stub helper contract * fix(test): preserve sites stub probe imports --------- Co-authored-by: jxxghp <jxxghp@gmail.com>
This commit is contained in:
@@ -302,8 +302,7 @@ import app.monitor
|
||||
assert not any(name.startswith('app.doctor.') for name in sys.modules)
|
||||
assert not any(name.startswith('app.monitor.') for name in sys.modules)
|
||||
|
||||
# CI 无 app.application.site.sites 资源模块,触发实现加载前先补 conftest 同源垫片;
|
||||
# 独立子进程不经过 pytest 引导,必须在此显式安装,否则链式 import 会因缺模块失败。
|
||||
# 独立子进程不经过 pytest 引导,触发实现加载前必须隔离站点原生制品。
|
||||
from app.testing.bootstrap import ensure_sites_stub
|
||||
ensure_sites_stub()
|
||||
|
||||
|
||||
Reference in New Issue
Block a user