mirror of
https://github.com/BerriAI/litellm.git
synced 2026-09-23 00:41:40 +00:00
- conftest: pytest_runtest_makereport now early-returns on report.skipped so pytest.skip(...) inside a compat test body doesn't get recorded as a phantom 'fail' row via the not-failed/empty-collected branch. - _basic_messaging: drop require_stream_events. The check (not outcome.events) cannot catch a buffering regression because cli_driver uses subprocess.run(capture_output=True), which only exposes the post-exit stdout blob — buffered-then-flushed and truly streamed responses are indistinguishable. The check was also unreachable as an independent failure path (empty events -> empty text -> the text check fires first). Update all five streaming callers and docstrings accordingly. Co-authored-by: Yassin Kortam <yassin@berri.ai>
39 lines
1.3 KiB
Python
39 lines
1.3 KiB
Python
"""basic_messaging_streaming x Azure (Microsoft Foundry).
|
|
|
|
Drive the real `claude` CLI in headless `--output-format stream-json`
|
|
mode against a running LiteLLM proxy that routes Claude requests to
|
|
Anthropic's models hosted in Microsoft Foundry on Azure, and report the
|
|
outcome via `compat_result`.
|
|
|
|
Foundry exposes Claude on an Anthropic-shape `/anthropic/v1/messages`
|
|
endpoint with native SSE streaming; LiteLLM forwards stream events
|
|
through the `azure_ai/claude-*` provider unchanged.
|
|
|
|
The (feature, provider) for this cell is inferred from the file path by
|
|
`tests/claude_code/conftest.py`:
|
|
|
|
tests/claude_code/basic_messaging_streaming/test_azure.py
|
|
^^^^^^^^^^^^^^^^^^^^^^^^^ ^^^^^
|
|
feature_id provider
|
|
"""
|
|
|
|
from __future__ import annotations
|
|
|
|
from tests.claude_code._basic_messaging import run_basic_messaging_cell
|
|
|
|
AZURE_MODELS = [
|
|
"claude-haiku-4-5-azure",
|
|
"claude-sonnet-4-6-azure",
|
|
"claude-opus-4-7-azure",
|
|
]
|
|
|
|
|
|
def test_basic_messaging_streaming_azure(compat_result):
|
|
"""Drive the `claude` CLI against the LiteLLM proxy and assert a
|
|
non-empty streamed reply (one row per Claude tier).
|
|
"""
|
|
run_basic_messaging_cell(
|
|
compat_result=compat_result,
|
|
models=AZURE_MODELS,
|
|
prompt="Count from 1 to 5, one number per line.",
|
|
)
|