Skip to content

Python SDK for AI agent monitoring, LLM cost tracking, benchmarking, and more. Integrates with most LLMs and agent frameworks including CrewAI, Agno, OpenAI Agents SDK, Langchain, Autogen, AG2, and CamelAI

499 B
Raw Blame
import pytest

from agentops import Client


@pytest.fixture(autouse=True)
def reset_client():
    """Reset the client singleton before and after each test"""
    # Reset the Client singleton by resetting its class attributes
    if getattr(Client, "__instance", None):
        del Client.__instance
    yield
    # Reset again after the test
    Client.__instance = None


@pytest.fixture(autouse=True)
def mock_client(reset_client):
    # Resets the client with a clear env
    Client()
    yield