Skip to content

Commit cced4f3

Browse files
Format parser and tool tests for Ruff compliance
Co-authored-by: Shri Sukhani <shrisukhani@users.noreply.github.com>
1 parent 32e8e24 commit cced4f3

2 files changed

Lines changed: 15 additions & 5 deletions

File tree

tests/test_extension_utils.py

Lines changed: 9 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -319,7 +319,9 @@ def __getitem__(self, key: str) -> object:
319319
HyperbrowserError,
320320
match="Failed to read extension object value for key 'name' at index 0",
321321
) as exc_info:
322-
parse_extension_list_response_data({"extensions": [_BrokenValueLookupMapping()]})
322+
parse_extension_list_response_data(
323+
{"extensions": [_BrokenValueLookupMapping()]}
324+
)
323325

324326
assert exc_info.value.original_error is not None
325327

@@ -340,7 +342,9 @@ def __getitem__(self, key: str) -> object:
340342
HyperbrowserError,
341343
match="Failed to read extension object value for key 'bad\\?key' at index 0",
342344
) as exc_info:
343-
parse_extension_list_response_data({"extensions": [_BrokenValueLookupMapping()]})
345+
parse_extension_list_response_data(
346+
{"extensions": [_BrokenValueLookupMapping()]}
347+
)
344348

345349
assert exc_info.value.original_error is not None
346350

@@ -360,6 +364,8 @@ def __getitem__(self, key: str) -> object:
360364
with pytest.raises(
361365
HyperbrowserError, match="custom extension value read failure"
362366
) as exc_info:
363-
parse_extension_list_response_data({"extensions": [_BrokenValueLookupMapping()]})
367+
parse_extension_list_response_data(
368+
{"extensions": [_BrokenValueLookupMapping()]}
369+
)
364370

365371
assert exc_info.value.original_error is None

tests/test_tools_mapping_inputs.py

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -122,7 +122,9 @@ def __getitem__(self, key: str) -> object:
122122

123123
client = _Client()
124124

125-
with pytest.raises(HyperbrowserError, match="Failed to read tool params keys") as exc_info:
125+
with pytest.raises(
126+
HyperbrowserError, match="Failed to read tool params keys"
127+
) as exc_info:
126128
WebsiteScrapeTool.runnable(client, _BrokenKeyMapping())
127129

128130
assert exc_info.value.original_error is not None
@@ -142,7 +144,9 @@ def __getitem__(self, key: str) -> object:
142144

143145
client = _Client()
144146

145-
with pytest.raises(HyperbrowserError, match="Failed to read tool param 'url'") as exc_info:
147+
with pytest.raises(
148+
HyperbrowserError, match="Failed to read tool param 'url'"
149+
) as exc_info:
146150
WebsiteScrapeTool.runnable(client, _BrokenValueMapping())
147151

148152
assert exc_info.value.original_error is not None

0 commit comments

Comments
 (0)