Skip to content

Commit c0d3f64

Browse files
author
SentienceDEV
committed
fix tests
1 parent 4f88606 commit c0d3f64

File tree

1 file changed

+6
-3
lines changed

1 file changed

+6
-3
lines changed

tests/unit/test_tool_registry.py

Lines changed: 6 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -149,8 +149,9 @@ def can(self, _name: str) -> bool:
149149
return False
150150

151151
ctx = ToolContext(RuntimeStub())
152-
with pytest.raises(UnsupportedCapabilityError, match="unsupported_capability"):
152+
with pytest.raises(UnsupportedCapabilityError) as excinfo:
153153
ctx.require("tabs")
154+
assert excinfo.value.error == "unsupported_capability"
154155

155156

156157
@pytest.mark.asyncio
@@ -219,12 +220,14 @@ async def snapshot(self, **_kwargs):
219220
ctx = ToolContext(RuntimeStub())
220221
register_default_tools(registry, ctx)
221222

222-
with pytest.raises(UnsupportedCapabilityError, match="unsupported_capability"):
223+
with pytest.raises(UnsupportedCapabilityError) as excinfo:
223224
await registry.execute("press", {"key": "Enter"}, ctx=ctx)
225+
assert excinfo.value.error == "unsupported_capability"
224226

225-
with pytest.raises(UnsupportedCapabilityError, match="unsupported_capability"):
227+
with pytest.raises(UnsupportedCapabilityError) as excinfo:
226228
await registry.execute(
227229
"scroll_to_element",
228230
{"element_id": 1, "behavior": "instant", "block": "center"},
229231
ctx=ctx,
230232
)
233+
assert excinfo.value.error == "unsupported_capability"

0 commit comments

Comments
 (0)