From 619179991fee22b9648cea8580aef24942b64171 Mon Sep 17 00:00:00 2001 From: Jeremiah Lowin <153965+jlowin@users.noreply.github.com> Date: Thu, 24 Oct 2024 20:43:21 -0400 Subject: [PATCH] Fix formatting --- tests/events/test_history.py | 11 ++++++++--- 1 file changed, 8 insertions(+), 3 deletions(-) diff --git a/tests/events/test_history.py b/tests/events/test_history.py index 8c4f5124..ea92a309 100644 --- a/tests/events/test_history.py +++ b/tests/events/test_history.py @@ -1,8 +1,12 @@ +import threading + +import pytest + from controlflow.events.events import UserMessage from controlflow.events.history import FileHistory from controlflow.flows import Flow -import threading -import pytest + + class TestFileHistory: def test_write_to_thread_id_file(self, tmp_path): h = FileHistory(base_path=tmp_path) @@ -45,6 +49,7 @@ def test_file_history_creates_dir(self, tmp_path): h.add_events(thread_id, [event]) assert (tmp_path / "subdir" / f"{thread_id}.json").exists() + def test_add_none_event(self, tmp_path): """Test adding a None event should raise a ValueError""" h = FileHistory(base_path=tmp_path) @@ -92,7 +97,7 @@ def test_flow_sets_thread_id_for_file_history(self, tmp_path): assert len(f1.get_events()) == 1 assert len(f2.get_events()) == 0 assert len(f3.get_events()) == 1 - + def test_concurrent_access(self, tmp_path): """Test concurrent access to the same thread file""" f1 = Flow(thread_id="abc", history=FileHistory(base_path=tmp_path))