Round 3 fixes: cancelled polling, aggregator invalid_count, filter state, scheduler atomicity, HTTP exception handler, tests

This commit is contained in:
祀梦
2026-04-05 10:20:23 +08:00
parent 49e440cb41
commit dc5f050683
32 changed files with 321 additions and 163 deletions

View File

@@ -85,12 +85,14 @@ async def sample_proxy(db, proxy_repo):
@pytest_asyncio.fixture(autouse=True)
async def mock_external_requests(monkeypatch):
async def mock_external_requests(monkeypatch, request):
"""
自动在所有测试中 mock 外部网络请求:
自动在集成/E2E 测试中 mock 外部网络请求:
1. 插件爬取返回固定测试代理,避免真实 HTTP 请求
2. 代理验证瞬间成功,避免连接超时等待
"""
if "/unit/" in request.node.nodeid:
return
from app.services.plugin_runner import PluginRunner
from app.services.validator_service import ValidatorService