test(usage): mark new gateway usage tests with @pytest.mark.unit (round 6)
Round-6 claude-review (ready to merge): the three new GatewayProvider usage/bearer tests lacked @pytest.mark.unit, so `pytest -m unit` skipped them even though every other new test in this PR is marked. Add the marker to the three new tests (leaving the pre-existing unmarked tests in the file alone). Remaining 🟢 items (OpenAI embed() dual path, recursion-invariant runtime enforcement, Bedrock sync-in-async) are acknowledged deferrals — separate refactors, unchanged. Deck #67. Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
This commit is contained in:
co-authored by
Claude Opus 4.8
parent
141663bb07
commit
ddefb03701
@@ -328,6 +328,7 @@ def test_trailing_slash_base_url_normalized():
|
||||
assert not base.endswith("/v1/v1")
|
||||
|
||||
|
||||
@pytest.mark.unit
|
||||
async def test_gateway_embed_with_usage_forwards_after_bearer(monkeypatch):
|
||||
"""embed_with_usage refreshes the bearer, then returns the (embedding,
|
||||
token_count) from the inherited OpenAI implementation."""
|
||||
@@ -363,6 +364,7 @@ async def test_gateway_embed_with_usage_forwards_after_bearer(monkeypatch):
|
||||
assert order == ["bearer", "embed"] # bearer refreshed before the embed call
|
||||
|
||||
|
||||
@pytest.mark.unit
|
||||
async def test_gateway_embed_batch_with_usage_forwards_after_bearer(monkeypatch):
|
||||
"""embed_batch_with_usage also refreshes the bearer before delegating."""
|
||||
# https mock host (never contacted — the OpenAI client is patched below).
|
||||
@@ -393,6 +395,7 @@ async def test_gateway_embed_batch_with_usage_forwards_after_bearer(monkeypatch)
|
||||
assert ensured["n"] == 1
|
||||
|
||||
|
||||
@pytest.mark.unit
|
||||
async def test_gateway_embed_batch_ensures_bearer_once(monkeypatch):
|
||||
"""embed_batch() has no override: it routes through the inherited OpenAI
|
||||
embed_batch() → embed_batch_with_usage() (overridden), so the bearer is
|
||||
|
||||
Reference in New Issue
Block a user