Compare commits

...
Author SHA1 Message Date
Jon Saad-FalconandClaude Opus 4.8 590addae4c test(engine): expect EngineConnectionError for vllm 404 (fix main CI) (#530)
#463 made the OpenAI-compatible engine wrap upstream HTTP errors (incl.
404) in EngineConnectionError with an actionable message, but
test_invalid_model_404 still asserted the raw httpx.HTTPStatusError, so it
broke on main once #463 landed (#463 was a stale fork PR with no CI, so it
wasn't caught pre-merge). Expect EngineConnectionError now, asserting the
httpx.HTTPStatusError is preserved as the chained cause. Whole tests/engine
suite is green again.

Co-authored-by: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
2026-06-10 14:09:37 -07:00
+5 -1
View File
@@ -204,10 +204,14 @@ class TestVLLMErrors:
respx_mock.post(f"{VLLM_HOST}/v1/chat/completions").mock(
return_value=httpx.Response(404, json={"error": "model not found"})
)
with pytest.raises(httpx.HTTPStatusError):
# The OpenAI-compatible engine wraps upstream HTTP errors (incl. 404)
# in EngineConnectionError with an actionable message (see #463); the
# raw httpx.HTTPStatusError is the chained cause.
with pytest.raises(EngineConnectionError) as exc_info:
engine.generate(
[Message(role=Role.USER, content="Hi")], model="nonexistent"
)
assert isinstance(exc_info.value.__cause__, httpx.HTTPStatusError)
def test_timeout_raises_connection_error(self) -> None:
engine = _make_engine()