diff --git a/src/intelligence_layer/core/tracer/tracer.py b/src/intelligence_layer/core/tracer/tracer.py index 91647a536..b74d08bdf 100644 --- a/src/intelligence_layer/core/tracer/tracer.py +++ b/src/intelligence_layer/core/tracer/tracer.py @@ -376,6 +376,14 @@ def end(self, timestamp: Optional[datetime] = None) -> None: def export_for_viewing(self) -> Sequence[ExportedSpan]: return [] + def __exit__( + self, + exc_type: Optional[type[BaseException]], + exc_value: Optional[BaseException], + _traceback: Optional[TracebackType], + ) -> None: + pass + class JsonSerializer(RootModel[PydanticSerializable]): root: SerializeAsAny[PydanticSerializable] diff --git a/tests/connectors/document_index/test_document_index.py b/tests/connectors/document_index/test_document_index.py index 6cc69a555..0cbd24311 100644 --- a/tests/connectors/document_index/test_document_index.py +++ b/tests/connectors/document_index/test_document_index.py @@ -198,7 +198,7 @@ def test_document_list_all_documents( ) -> None: filter_result = document_index.documents(collection_path) - assert len(filter_result) == 3 + assert len(filter_result) == 6 def test_document_list_max_n_documents( diff --git a/tests/core/tracer/test_in_memory_tracer.py b/tests/core/tracer/test_in_memory_tracer.py index 530faf0f7..a4124de29 100644 --- a/tests/core/tracer/test_in_memory_tracer.py +++ b/tests/core/tracer/test_in_memory_tracer.py @@ -99,8 +99,11 @@ def test_task_span_records_error_value() -> None: raise ValueError("my bad, sorry") assert isinstance(tracer.entries[0], InMemoryTaskSpan) - error = tracer.entries[0].output - assert isinstance(error, ErrorValue) + error_log = tracer.entries[0].entries[0] + assert isinstance(error_log, LogEntry) + + error = error_log.value + assert isinstance(error_log.value, ErrorValue) assert error.message == "my bad, sorry" assert error.error_type == "ValueError" assert error.stack_trace.startswith("Traceback")