File tree Expand file tree Collapse file tree 1 file changed +10
-2
lines changed
Expand file tree Collapse file tree 1 file changed +10
-2
lines changed Original file line number Diff line number Diff line change 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+
37import json
48from types import SimpleNamespace
5- from typing import Any , Dict
9+ from typing import Any , Dict , Optional
610from unittest .mock import Mock , patch
711
812import 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 (
You can’t perform that action at this time.
0 commit comments