Skip to content

Commit 8d652f7

Browse files
committed
fix(test): satisfy pyright on header assertion type
1 parent aa9d3b9 commit 8d652f7

1 file changed

Lines changed: 4 additions & 1 deletion

File tree

tests/auth/test_alibaba_auth.py

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,7 @@
11
from __future__ import annotations
22

3+
from typing import cast
4+
35
import aiohttp
46
import pytest
57
from multidict import CIMultiDict, CIMultiDictProxy
@@ -283,7 +285,8 @@ async def test_login_alibaba_uses_discovered_context_length(monkeypatch, tmp_pat
283285
config = Config(is_from_default_location=True)
284286

285287
async def fake_request(*args: object, **kwargs: object) -> object:
286-
assert kwargs["headers"].get("Authorization") == "Bearer sk-test"
288+
headers = cast("dict[str, object]", kwargs.get("headers", {}))
289+
assert headers.get("Authorization") == "Bearer sk-test"
287290
return _FakeAiohttpResponse({"data": [{"id": "qwen3.7-max", "context_length": 512_000}]})
288291

289292
monkeypatch.setattr(aiohttp.ClientSession, "_request", fake_request)

0 commit comments

Comments
 (0)