test: e2e conftest imports GatewayRunner at module level; elicitation test docstring matches the default thunk
Same cleanup as the previous commit, applied to the third file that carried the TYPE_CHECKING + in-function import pair. gateway.run imports none of the telegram/discord/ slack modules the conftest stubs, so import order is not a concern. test_feishu.py keeps its TYPE_CHECKING import on purpose (FeishuAdapter is gated on optional lark_oapi).
This commit is contained in:
@@ -12,19 +12,16 @@ No LLM, no real platform connections.
|
||||
import asyncio
|
||||
import sys
|
||||
import uuid
|
||||
from typing import TYPE_CHECKING
|
||||
from datetime import datetime, timezone
|
||||
from types import SimpleNamespace
|
||||
from unittest.mock import AsyncMock, MagicMock, patch
|
||||
|
||||
import pytest
|
||||
|
||||
if TYPE_CHECKING:
|
||||
from gateway.run import GatewayRunner
|
||||
|
||||
from gateway.config import GatewayConfig, Platform, PlatformConfig
|
||||
from gateway.platforms.base import SendResult
|
||||
from gateway.platforms.event import MessageEvent
|
||||
from gateway.run import GatewayRunner
|
||||
from gateway.session import SessionEntry, SessionSource, build_session_key
|
||||
|
||||
E2E_MESSAGE_SETTLE_DELAY = 0.3
|
||||
@@ -169,13 +166,11 @@ def make_event(
|
||||
)
|
||||
|
||||
|
||||
def make_runner(platform: Platform, session_entry: SessionEntry = None) -> "GatewayRunner":
|
||||
def make_runner(platform: Platform, session_entry: SessionEntry = None) -> GatewayRunner:
|
||||
"""Create a GatewayRunner with mocked internals for e2e testing.
|
||||
|
||||
Skips __init__ to avoid filesystem/network side effects.
|
||||
"""
|
||||
from gateway.run import GatewayRunner
|
||||
|
||||
if session_entry is None:
|
||||
session_entry = make_session_entry(platform)
|
||||
|
||||
|
||||
@@ -250,7 +250,7 @@ class TestElicitationHandlerContextBridge:
|
||||
)
|
||||
|
||||
def test_missing_captured_context_falls_back_to_direct_call(self):
|
||||
"""Without a call_context (or one whose task hasn't entered a tool
|
||||
"""With the default call_context (or one whose task has not entered a tool
|
||||
call) the handler must still invoke the consent router -- just
|
||||
without the contextvar replay. Otherwise CLI/TUI sessions, which
|
||||
don't set HERMES_SESSION_PLATFORM, would break."""
|
||||
|
||||
Reference in New Issue
Block a user