mirror of
https://github.com/crewAIInc/crewAI.git
synced 2025-12-15 20:08:29 +00:00
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:
@@ -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
|
||||
|
||||
@@ -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
|
||||
|
||||
Reference in New Issue
Block a user