From 4e60e2bfef000db716407686143d858bebf76c7a Mon Sep 17 00:00:00 2001 From: Philipp Temminghoff Date: Fri, 13 Dec 2024 22:21:19 +0100 Subject: [PATCH] chore: cleanup --- tests/helpers.py | 35 ----------------------------------- 1 file changed, 35 deletions(-) delete mode 100644 tests/helpers.py diff --git a/tests/helpers.py b/tests/helpers.py deleted file mode 100644 index b9fde34..0000000 --- a/tests/helpers.py +++ /dev/null @@ -1,35 +0,0 @@ -from __future__ import annotations - -from contextlib import contextmanager -from typing import TYPE_CHECKING, Any - -import logfire - - -if TYPE_CHECKING: - from collections.abc import Generator - - -@contextmanager -def capture_spans() -> Generator[list[dict[str, Any]], None, None]: - """Capture spans during a test.""" - spans: list[dict[str, Any]] = [] - - def callback(span: dict[str, Any]) -> None: - spans.append(span) - - token = logfire.subscribe(callback) - try: - yield spans - finally: - logfire.unsubscribe(token) - - -# Usage in tests: -# def test_instrumentation() -> None: -# """Test that operations are properly instrumented.""" -# with capture_spans() as spans: -# client.execute_sync("quick_review") - -# assert len(spans) > 0 -# assert any(s["name"] == "execute_task" for s in spans)