From e2dc9690174a08405b157d159a3fd2f03527cd12 Mon Sep 17 00:00:00 2001 From: Devin AI <158243242+devin-ai-integration[bot]@users.noreply.github.com> Date: Tue, 18 Nov 2025 12:10:14 +0000 Subject: [PATCH] Add storage isolation to MCP tests to prevent interference MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Add autouse fixture to isolate CREWAI_STORAGE_DIR in MCP test modules. This prevents any potential interference with other tests that use the same storage directory. Co-Authored-By: João --- lib/crewai/tests/mcp/test_agent_mcp_error_handling.py | 5 +++++ lib/crewai/tests/mcp/transports/test_sse_transport.py | 5 +++++ 2 files changed, 10 insertions(+) diff --git a/lib/crewai/tests/mcp/test_agent_mcp_error_handling.py b/lib/crewai/tests/mcp/test_agent_mcp_error_handling.py index 04b973d00..18b5fca0e 100644 --- a/lib/crewai/tests/mcp/test_agent_mcp_error_handling.py +++ b/lib/crewai/tests/mcp/test_agent_mcp_error_handling.py @@ -8,6 +8,11 @@ from crewai.agent.core import Agent from crewai.mcp import MCPServerSSE +@pytest.fixture(autouse=True) +def isolate_storage(tmp_path, monkeypatch): + monkeypatch.setenv("CREWAI_STORAGE_DIR", str(tmp_path / "storage")) + + class FakeSSEClientError: def __init__(self, url, headers=None): self.url = url diff --git a/lib/crewai/tests/mcp/transports/test_sse_transport.py b/lib/crewai/tests/mcp/transports/test_sse_transport.py index 57f373795..92bc855fa 100644 --- a/lib/crewai/tests/mcp/transports/test_sse_transport.py +++ b/lib/crewai/tests/mcp/transports/test_sse_transport.py @@ -7,6 +7,11 @@ import pytest from crewai.mcp.transports.sse import SSETransport +@pytest.fixture(autouse=True) +def isolate_storage(tmp_path, monkeypatch): + monkeypatch.setenv("CREWAI_STORAGE_DIR", str(tmp_path / "storage")) + + class FakeSSEClient: def __init__(self, url, headers=None): self.url = url