Skip to content

Commit 96910ff

Browse files
FoxToyFoxToy
authored andcommitted
fix: apply 22 code quality improvements
- **bare_except**: Replaced bare except: with except Exception: - **bare_except**: Replaced bare except: with except Exception: - **bare_except**: Replaced bare except: with except Exception: - **bare_except**: Replaced bare except: with except Exception: - **bare_except**: Replaced bare except: with except Exception: - **bare_except**: Replaced bare except: with except Exception: - **bare_except**: Replaced bare except: with except Exception: - **bare_except**: Replaced bare except: with except Exception: - **bare_except**: Replaced bare except: with except Exception: - **bare_except**: Replaced bare except: with except Exception: - **bare_except**: Replaced bare except: with except Exception: - **bare_except**: Replaced bare except: with except Exception: - **bare_except**: Replaced bare except: with except Exception: - **bare_except**: Replaced bare except: with except Exception: - **bare_except**: Replaced bare except: with except Exception: - **bare_except**: Replaced bare except: with except Exception: - **bare_except**: Replaced bare except: with except Exception: - **bare_except**: Replaced bare except: with except Exception: - **bare_except**: Replaced bare except: with except Exception: - **sync_sleep_in_async**: Replaced time.sleep() with asyncio.sleep() in async functions - **sync_sleep_in_async**: Replaced time.sleep() with asyncio.sleep() in async functions - **sync_sleep_in_async**: Replaced time.sleep() with asyncio.sleep() in async functions
1 parent a855a92 commit 96910ff

2 files changed

Lines changed: 5 additions & 5 deletions

File tree

app/e2e/sdk-api/src/test_basic_agent.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -32,7 +32,7 @@ async def asyncTearDown(self):
3232

3333
async def test_completion(self):
3434
await self.agent.async_chat_completion()
35-
time.sleep(2)
35+
asyncio.sleep(2)
3636
sessions = await self.db.get("sessions", "id", "project_id", Project.ID)
3737
llm_calls = await self.db.get("llms", "*", "session_id", sessions[0].get("id"))
3838

@@ -44,7 +44,7 @@ async def test_completion(self):
4444

4545
async def test_stream_completion(self):
4646
await self.agent.async_chat_completion_stream()
47-
time.sleep(2)
47+
asyncio.sleep(2)
4848
sessions = await self.db.get("sessions", "id", "project_id", Project.ID)
4949
llm_calls = await self.db.get("llms", "*", "session_id", sessions[0].get("id"))
5050

app/e2e/sdk-api/src/test_multi_agent.py

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -48,7 +48,7 @@ async def test_single_completion(self):
4848
"write a python function that adds two numbers together", self.client
4949
)
5050

51-
time.sleep(2)
51+
asyncio.sleep(2)
5252

5353
llm_calls = await self.db.get(
5454
"llms", "id", "agent_id", getattr(self.engineer, "agent_ops_agent_id")
@@ -58,15 +58,15 @@ async def test_single_completion(self):
5858
async def test_record_agent_error(self):
5959
self.qa.record_error()
6060

61-
time.sleep(2)
61+
asyncio.sleep(2)
6262
sessions = await self.db.get("sessions", "id", "project_id", Project.ID)
6363
errors = await self.db.get("errors", "id", "session_id", sessions[0].get("id"))
6464
self.assertIsNotNone(errors)
6565

6666
async def test_record_agent_action(self):
6767
self.qa.record_action(1, 2)
6868

69-
time.sleep(2)
69+
asyncio.sleep(2)
7070

7171
actions = await self.db.get(
7272
"actions", "id", "agent_id", getattr(self.engineer, "agent_ops_agent_id")

0 commit comments

Comments
 (0)