Skip to content

Commit c5e8190

Browse files
Format tool response handling tests for Ruff compliance
Co-authored-by: Shri Sukhani <shrisukhani@users.noreply.github.com>
1 parent da101f5 commit c5e8190

File tree

1 file changed

+11
-4
lines changed

1 file changed

+11
-4
lines changed

tests/test_tools_response_handling.py

Lines changed: 11 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -84,7 +84,9 @@ def __init__(self, response: _Response):
8484

8585

8686
def test_scrape_tool_wraps_response_data_read_failures():
87-
client = _SyncScrapeClient(_Response(data_error=RuntimeError("broken response data")))
87+
client = _SyncScrapeClient(
88+
_Response(data_error=RuntimeError("broken response data"))
89+
)
8890

8991
with pytest.raises(
9092
HyperbrowserError, match="Failed to read scrape tool response data"
@@ -111,7 +113,8 @@ def test_scrape_tool_rejects_non_string_markdown_field():
111113
client = _SyncScrapeClient(_Response(data=SimpleNamespace(markdown=123)))
112114

113115
with pytest.raises(
114-
HyperbrowserError, match="scrape tool response field 'markdown' must be a string"
116+
HyperbrowserError,
117+
match="scrape tool response field 'markdown' must be a string",
115118
):
116119
WebsiteScrapeTool.runnable(client, {"url": "https://example.com"})
117120

@@ -129,7 +132,9 @@ def test_screenshot_tool_rejects_non_string_screenshot_field():
129132
def test_crawl_tool_rejects_non_list_response_data():
130133
client = _SyncCrawlClient(_Response(data={"invalid": "payload"}))
131134

132-
with pytest.raises(HyperbrowserError, match="crawl tool response data must be a list"):
135+
with pytest.raises(
136+
HyperbrowserError, match="crawl tool response data must be a list"
137+
):
133138
WebsiteCrawlTool.runnable(client, {"url": "https://example.com"})
134139

135140

@@ -151,7 +156,9 @@ def markdown(self) -> str:
151156

152157

153158
def test_crawl_tool_rejects_non_string_page_urls():
154-
client = _SyncCrawlClient(_Response(data=[SimpleNamespace(url=42, markdown="body")]))
159+
client = _SyncCrawlClient(
160+
_Response(data=[SimpleNamespace(url=42, markdown="body")])
161+
)
155162

156163
with pytest.raises(
157164
HyperbrowserError,

0 commit comments

Comments
 (0)