mirror of
https://github.com/jxxghp/MoviePilot.git
synced 2026-09-04 15:09:46 +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:
@@ -43,9 +43,9 @@ import json
|
||||
import sys
|
||||
import time
|
||||
|
||||
from app.testing.bootstrap import install_sites_stub
|
||||
from app.testing.bootstrap import ensure_sites_stub
|
||||
|
||||
install_sites_stub()
|
||||
ensure_sites_stub()
|
||||
before = set(sys.modules)
|
||||
started_at = time.perf_counter()
|
||||
importlib.import_module({target!r})
|
||||
@@ -100,9 +100,9 @@ import time
|
||||
|
||||
from fastapi import FastAPI
|
||||
|
||||
from app.testing.bootstrap import install_sites_stub
|
||||
from app.testing.bootstrap import ensure_sites_stub
|
||||
|
||||
install_sites_stub()
|
||||
ensure_sites_stub()
|
||||
from app.startup import lifecycle
|
||||
|
||||
|
||||
|
||||
Reference in New Issue
Block a user