Skip to content

Commit 08680ba

Browse files
committed
fix(test_portkey_integration.py): lint fixes
1 parent 03c36e1 commit 08680ba

File tree

1 file changed

+10
-2
lines changed

1 file changed

+10
-2
lines changed

tests/test_portkey_integration.py

Lines changed: 10 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,12 @@
11
"""Test Portkey tracer integration."""
22

3+
# openlayer.lib.integrations is in pyright's ignore list, so imports from portkey_tracer
4+
# get unknown/partially unknown types; disable these diagnostics for this test file only.
5+
# pyright: reportUnknownVariableType=false, reportUnknownMemberType=false
6+
37
import json
48
from types import SimpleNamespace
5-
from typing import Any, Dict
9+
from typing import Any, Dict, Optional
610
from unittest.mock import Mock, patch
711

812
import pytest # type: ignore
@@ -244,7 +248,11 @@ def test_calculate_streaming_usage_and_cost_with_actual_usage(self) -> None:
244248
"""Actual usage data should be returned when available."""
245249
from openlayer.lib.integrations.portkey_tracer import calculate_streaming_usage_and_cost
246250

247-
latest_usage = {"total_tokens": 100, "prompt_tokens": 40, "completion_tokens": 60}
251+
latest_usage: Dict[str, Optional[int]] = {
252+
"total_tokens": 100,
253+
"prompt_tokens": 40,
254+
"completion_tokens": 60,
255+
}
248256
latest_metadata = {"cost": 0.99}
249257

250258
result = calculate_streaming_usage_and_cost(

0 commit comments

Comments
 (0)