Add storage isolation to MCP tests to prevent interference

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 <joao@crewai.com>
This commit is contained in:
Devin AI
2025-11-18 12:10:14 +00:00
parent 54c29e843e
commit e2dc969017
2 changed files with 10 additions and 0 deletions

View File

@@ -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

View File

@@ -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