diff --git a/src/tests/backend/common/database/test_database_base.py b/src/tests/backend/common/database/test_database_base.py index 128d26cf7..3507f5d1c 100644 --- a/src/tests/backend/common/database/test_database_base.py +++ b/src/tests/backend/common/database/test_database_base.py @@ -500,8 +500,8 @@ async def get_team_agent(self, team_id, agent_name): return None # Raise an exception to test cleanup raise ValueError("Test exception") - # Even with exception, close should have been called - assert database.closed is True + # Even with exception, close should have been called + assert database.closed is True class TestDatabaseBaseInheritance: diff --git a/src/tests/backend/v4/config/test_settings.py b/src/tests/backend/v4/config/test_settings.py index 44c8191e7..d254cff10 100644 --- a/src/tests/backend/v4/config/test_settings.py +++ b/src/tests/backend/v4/config/test_settings.py @@ -336,17 +336,13 @@ async def test_wait_for_approval_cancelled(self): config.set_approval_pending(plan_id) - async def cancel_task(): - await asyncio.sleep(0.05) - task.cancel() - task = asyncio.create_task(config.wait_for_approval(plan_id, timeout=1.0)) - cancel_task_handle = asyncio.create_task(cancel_task()) + await asyncio.sleep(0.05) + task.cancel() with self.assertRaises(asyncio.CancelledError): _ = await task - await cancel_task_handle self.assertTrue(task.cancelled()) async def test_wait_for_clarification_cancelled(self): @@ -357,17 +353,13 @@ async def test_wait_for_clarification_cancelled(self): config.set_clarification_pending(request_id) - async def cancel_task(): - await asyncio.sleep(0.05) - task.cancel() - task = asyncio.create_task(config.wait_for_clarification(request_id, timeout=1.0)) - cancel_task_handle = asyncio.create_task(cancel_task()) + await asyncio.sleep(0.05) + task.cancel() with self.assertRaises(asyncio.CancelledError): _ = await task - await cancel_task_handle self.assertTrue(task.cancelled()) def test_cleanup_approval(self):