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:
@@ -14,8 +14,7 @@ def test_main_script_does_not_shadow_stdlib_platform(tmp_path):
|
||||
(
|
||||
"import runpy",
|
||||
"import sys",
|
||||
# CI 无 app.application.site.sites 二进制模块,先补垫片再执行 main.py(与 conftest 同源);
|
||||
# 必须在篡改 sys.path / 摘除 platform 之前调用,避免真实依赖链受探针环境影响。
|
||||
# 独立探针不经过 pytest 引导,先隔离站点原生制品,再改变模块搜索路径。
|
||||
"from app.testing.bootstrap import ensure_sites_stub",
|
||||
"ensure_sites_stub()",
|
||||
f"sys.path.insert(0, {str(MAIN_PATH.parent)!r})",
|
||||
|
||||
Reference in New Issue
Block a user