MCPcopy
hub / github.com/plotly/dash / _reset_dash_app_state

Function _reset_dash_app_state

tests/integration/mcp/conftest.py:36–52  ·  view source on GitHub ↗

Reset Dash module-level state after each MCP test.

()

Source from the content-addressed store, hash-verified

34
35@pytest.fixture(autouse=True)
36def _reset_dash_app_state():
37 """Reset Dash module-level state after each MCP test."""
38 initial_resources = list(_RESOURCE_PROVIDERS)
39 initial_tools = list(_TOOL_PROVIDERS)
40 initial_callbacks_default = CallbackTools.callbacks_mcp_enabled_by_default
41 initial_expose_docstrings = CallbackTools.expose_docstrings_by_default
42
43 yield
44
45 _RESOURCE_PROVIDERS[:] = initial_resources
46 _TOOL_PROVIDERS[:] = initial_tools
47 CallbackTools.callbacks_mcp_enabled_by_default = initial_callbacks_default
48 CallbackTools.expose_docstrings_by_default = initial_expose_docstrings
49 MCP_DECORATED_FUNCTIONS.clear()
50 _configure._current_config = dict(_configure._DEFAULT_CONFIG)
51 _get_app.APP = None
52 _get_app.app_context.set(None)
53
54
55def _mcp_post(server_url, method, params=None, request_id=1):

Callers

nothing calls this directly

Calls 2

clearMethod · 0.45
setMethod · 0.45

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…