Skip to content

Commit

Permalink
Fix formatting
Browse files Browse the repository at this point in the history
  • Loading branch information
jlowin committed Oct 25, 2024
1 parent 72defdd commit 6191799
Showing 1 changed file with 8 additions and 3 deletions.
11 changes: 8 additions & 3 deletions tests/events/test_history.py
Original file line number Diff line number Diff line change
@@ -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)
Expand Down Expand Up @@ -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)
Expand Down Expand Up @@ -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))
Expand Down

0 comments on commit 6191799

Please sign in to comment.