1212from reducers import handle_compaction
1313
1414
15- @pytest .fixture ()
15+ @pytest .fixture
1616def mock_openai_client_wrapper ():
1717 """Create a mock OpenAIClientWrapper that doesn't need an API key"""
1818 with patch ("models.OpenAIClientWrapper" ) as mock_wrapper :
@@ -33,7 +33,7 @@ def mock_openai_client_wrapper():
3333
3434
3535class TestHealthEndpoint :
36- @pytest .mark .asyncio ()
36+ @pytest .mark .asyncio
3737 async def test_health_endpoint (self , client ):
3838 """Test the health endpoint"""
3939 response = await client .get ("/health" )
@@ -93,8 +93,8 @@ async def test_get_memory(self, client, test_session_setup):
9393 assert data ["context" ] == "Sample context"
9494 assert int (data ["tokens" ]) == 150 # Convert string to int for comparison
9595
96- @pytest .mark .requires_api_keys ()
97- @pytest .mark .asyncio ()
96+ @pytest .mark .requires_api_keys
97+ @pytest .mark .asyncio
9898 async def test_post_memory (self , client ):
9999 """Test the post_memory endpoint"""
100100 payload = {
@@ -113,8 +113,8 @@ async def test_post_memory(self, client):
113113 assert "status" in data
114114 assert data ["status" ] == "ok"
115115
116- @pytest .mark .requires_api_keys ()
117- @pytest .mark .asyncio ()
116+ @pytest .mark .requires_api_keys
117+ @pytest .mark .asyncio
118118 async def test_post_memory_stores_in_long_term_memory (self , client ):
119119 """Test the post_memory endpoint"""
120120 payload = {
@@ -144,8 +144,8 @@ async def test_post_memory_stores_in_long_term_memory(self, client):
144144 assert mock_add_task .call_count == 1
145145 assert mock_add_task .call_args [0 ][0 ] == index_messages
146146
147- @pytest .mark .requires_api_keys ()
148- @pytest .mark .asyncio ()
147+ @pytest .mark .requires_api_keys
148+ @pytest .mark .asyncio
149149 async def test_post_memory_compacts_long_conversation (self , client ):
150150 """Test the post_memory endpoint"""
151151 payload = {
@@ -175,7 +175,7 @@ async def test_post_memory_compacts_long_conversation(self, client):
175175 assert mock_add_task .call_count == 1
176176 assert mock_add_task .call_args [0 ][0 ] == handle_compaction
177177
178- @pytest .mark .asyncio ()
178+ @pytest .mark .asyncio
179179 async def test_delete_memory (self , client , test_session_setup ):
180180 """Test the delete_memory endpoint"""
181181 session_id = test_session_setup
@@ -201,10 +201,10 @@ async def test_delete_memory(self, client, test_session_setup):
201201 assert len (data ["messages" ]) == 0
202202
203203
204- @pytest .mark .requires_api_keys ()
204+ @pytest .mark .requires_api_keys
205205class TestRetrievalEndpoint :
206206 @patch ("retrieval.search_messages" )
207- @pytest .mark .asyncio ()
207+ @pytest .mark .asyncio
208208 async def test_retrieval (self , mock_search , client ):
209209 """Test the retrieval endpoint"""
210210 mock_search .return_value = SearchResults (
0 commit comments