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:
InfinityPacer
2026-08-25 16:26:46 +08:00
committed by GitHub
co-authored by jxxghp
parent f3622de82e
commit c727d9c9f1
10 changed files with 31 additions and 49 deletions
+2 -2
View File
@@ -16,10 +16,10 @@ PROJECT_ROOT = Path(__file__).resolve().parents[2]
if str(PROJECT_ROOT) not in sys.path:
sys.path.insert(0, str(PROJECT_ROOT))
from app.testing.bootstrap import install_sites_stub, isolate_config_dir
from app.testing.bootstrap import ensure_sites_stub, isolate_config_dir
isolate_config_dir()
install_sites_stub()
ensure_sites_stub()
from app.startup import lifecycle
from app.startup.initializers import modules as modules_initializer