Skip to content

Commit 81856a3

Browse files
committed
chore: Delint
1 parent 10e45f1 commit 81856a3

File tree

1 file changed

+18
-9
lines changed

1 file changed

+18
-9
lines changed

packages/toolbox-core/tests/test_sync_client.py

Lines changed: 18 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -180,6 +180,7 @@ def mock_tool_invoke(
180180

181181
# --- Tests for General ToolboxSyncClient Functionality ---
182182

183+
183184
def test_sync_load_tool_success(aioresponses, test_tool_str_schema, sync_client):
184185
TOOL_NAME = "test_tool_sync_1"
185186
mock_tool_load(aioresponses, TOOL_NAME, test_tool_str_schema)
@@ -273,11 +274,15 @@ class TestSyncClientLifecycle:
273274

274275
def test_sync_client_creation_in_isolated_env(self, sync_client):
275276
"""Tests that a client is initialized correctly by the sync_client fixture."""
276-
assert sync_client._ToolboxSyncClient__loop is not None, "Loop should be created"
277+
assert (
278+
sync_client._ToolboxSyncClient__loop is not None
279+
), "Loop should be created"
277280
assert (
278281
sync_client._ToolboxSyncClient__thread is not None
279282
), "Thread should be created"
280-
assert sync_client._ToolboxSyncClient__thread.is_alive(), "Thread should be running"
283+
assert (
284+
sync_client._ToolboxSyncClient__thread.is_alive()
285+
), "Thread should be running"
281286
assert isinstance(
282287
sync_client._ToolboxSyncClient__async_client, ToolboxClient
283288
), "Async client should be ToolboxClient instance"
@@ -325,9 +330,7 @@ def test_sync_client_context_manager(self, aioresponses, tool_schema_minimal):
325330
ToolboxSyncClient, "close", wraps=ToolboxSyncClient.close, autospec=True
326331
) as mock_close_method_exc:
327332
with pytest.raises(ValueError, match="Test exception"):
328-
with ToolboxSyncClient(
329-
TEST_BASE_URL
330-
) as client_exc:
333+
with ToolboxSyncClient(TEST_BASE_URL) as client_exc:
331334
raise ValueError("Test exception")
332335
mock_close_method_exc.assert_called_once()
333336

@@ -351,26 +354,32 @@ def test_load_tool_raises_if_loop_or_thread_none(self):
351354

352355
# Manually break the class's loop to trigger the error condition in load_tool
353356
ToolboxSyncClient._ToolboxSyncClient__loop = None
354-
with pytest.raises(ValueError, match="Background loop or thread cannot be None."):
357+
with pytest.raises(
358+
ValueError, match="Background loop or thread cannot be None."
359+
):
355360
client.load_tool("any_tool_should_fail")
356361
ToolboxSyncClient._ToolboxSyncClient__loop = (
357362
original_class_loop # Restore for next check
358363
)
359364

360365
ToolboxSyncClient._ToolboxSyncClient__thread = None
361-
with pytest.raises(ValueError, match="Background loop or thread cannot be None."):
366+
with pytest.raises(
367+
ValueError, match="Background loop or thread cannot be None."
368+
):
362369
client.load_toolset("any_toolset_should_fail")
363370
ToolboxSyncClient._ToolboxSyncClient__thread = original_class_thread # Restore
364371

365-
client.close() # Clean up manually created client
372+
client.close() # Clean up manually created client
366373
# sync_client_environment will handle the final cleanup of original_class_loop/thread.
367374

368375

369376
class TestSyncClientHeaders:
370377
"""Additive tests for client header functionality specific to ToolboxSyncClient if any,
371378
or counterparts to async client header tests."""
372379

373-
def test_sync_add_headers_success(self, aioresponses, test_tool_str_schema, sync_client):
380+
def test_sync_add_headers_success(
381+
self, aioresponses, test_tool_str_schema, sync_client
382+
):
374383
tool_name = "tool_after_add_headers_sync"
375384
manifest = ManifestSchema(
376385
serverVersion="0.0.0", tools={tool_name: test_tool_str_schema}

0 commit comments

Comments
 (0)