Skip to content

Commit e48c46b

Browse files
committed
remove config mocking
1 parent dc1db2b commit e48c46b

1 file changed

Lines changed: 4 additions & 7 deletions

File tree

tests/unit/test_fastmcp.py

Lines changed: 4 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -155,14 +155,11 @@ async def failing_call_next(ctx):
155155
with mock.patch(
156156
"scout_apm.fastmcp.TrackedRequest.instance", return_value=mock_tracked
157157
):
158-
with mock.patch("scout_apm.fastmcp.scout_config") as mock_config:
159-
mock_config.value.return_value = False # errors_enabled = False
158+
with pytest.raises(ValueError, match="Tool failed"):
159+
await middleware.on_call_tool(mock_context, failing_call_next)
160160

161-
with pytest.raises(ValueError, match="Tool failed"):
162-
await middleware.on_call_tool(mock_context, failing_call_next)
163-
164-
# Verify error was tagged
165-
mock_tracked.tag.assert_any_call("error", "true")
161+
# Verify error was tagged
162+
mock_tracked.tag.assert_any_call("error", "true")
166163

167164
@pytest.mark.asyncio
168165
async def test_on_call_tool_skips_when_disabled(self):

0 commit comments

Comments
 (0)