MCPcopy Create free account
hub / github.com/IBM/mcp-cli / setup_test_context

Function setup_test_context

tests/conftest.py:16–39  ·  view source on GitHub ↗

Helper to set up test context with common defaults. Args: tool_manager: Optional tool manager to use **kwargs: Additional context parameters Returns: The initialized ApplicationContext

(tool_manager=None, **kwargs)

Source from the content-addressed store, hash-verified

14
15
16def setup_test_context(tool_manager=None, **kwargs):
17 """
18 Helper to set up test context with common defaults.
19
20 Args:
21 tool_manager: Optional tool manager to use
22 **kwargs: Additional context parameters
23
24 Returns:
25 The initialized ApplicationContext
26 """
27 # Reset first to ensure clean state
28 ContextManager().reset()
29
30 # Set defaults if not provided
31 if "provider" not in kwargs:
32 kwargs["provider"] = "openai"
33 if "model" not in kwargs:
34 kwargs["model"] = "gpt-4"
35
36 # Initialize with test defaults
37 context = initialize_context(tool_manager=tool_manager, **kwargs)
38
39 return context

Callers

nothing calls this directly

Calls 3

ContextManagerClass · 0.90
initialize_contextFunction · 0.90
resetMethod · 0.45

Tested by

no test coverage detected