@@ -258,9 +258,7 @@ async def test_lru_session_cleanup_lifecycle(self):
258258 # Should be sessions B and C (oldest last activity)
259259 assert "session_B" in lru_sessions , "Session B should be LRU"
260260 assert "session_C" in lru_sessions , "Session C should be LRU"
261- assert (
262- "session_A" not in lru_sessions
263- ), "Session A should NOT be LRU (recent activity)"
261+ assert "session_A" not in lru_sessions , "Session A should NOT be LRU (recent activity)"
264262 print ("✅ Phase 2: LRU detection working correctly" )
265263
266264 # PHASE 3: Trigger LRU cleanup
@@ -276,9 +274,7 @@ async def test_lru_session_cleanup_lifecycle(self):
276274
277275 # Verify session count is now at limit
278276 final_count = db ._cleanup_service .get_session_count ()
279- assert (
280- final_count == 3
281- ), f"Expected 3 sessions after cleanup, got { final_count } "
277+ assert final_count == 3 , f"Expected 3 sessions after cleanup, got { final_count } "
282278 print (f"✅ Phase 3: Session count reduced to { final_count } " )
283279
284280 # PHASE 4: Verify which sessions remain
@@ -308,15 +304,9 @@ async def test_lru_session_cleanup_lifecycle(self):
308304 print (f" ❌ { session_id } : DELETED (was least recently used)" )
309305
310306 # Verify correct sessions were kept/deleted
311- assert (
312- "session_A" in remaining_sessions
313- ), "Session A should remain (most recent activity)"
314- assert (
315- "session_D" in remaining_sessions
316- ), "Session D should remain (recent creation)"
317- assert (
318- "session_E" in remaining_sessions
319- ), "Session E should remain (most recent creation)"
307+ assert "session_A" in remaining_sessions , "Session A should remain (most recent activity)"
308+ assert "session_D" in remaining_sessions , "Session D should remain (recent creation)"
309+ assert "session_E" in remaining_sessions , "Session E should remain (most recent creation)"
320310 assert "session_B" in deleted_sessions , "Session B should be deleted (LRU)"
321311 assert "session_C" in deleted_sessions , "Session C should be deleted (LRU)"
322312
@@ -326,9 +316,7 @@ async def test_lru_session_cleanup_lifecycle(self):
326316 print ("\n 📊 PHASE 5: Verifying session record preservation..." )
327317
328318 session_a_records = await db .get_session_conversations ("session_A" )
329- assert (
330- len (session_a_records ) == 2
331- ), f"Session A should have 2 records, got { len (session_a_records )} "
319+ assert len (session_a_records ) == 2 , f"Session A should have 2 records, got { len (session_a_records )} "
332320
333321 # Check that both records exist
334322 sources = [r .source for r in session_a_records ]
0 commit comments